Java Screen Size getDefaultAppSize()

Here you can find the source of getDefaultAppSize()

Description

get Default App Size

License

LGPL

Declaration

public static Dimension getDefaultAppSize() 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.awt.Dimension;

import java.awt.Toolkit;

public class Main {
    public static Dimension getDefaultAppSize() {
        //      try {
        //         Preferences prefs = Preferences.getGlobalPreferences();
        //         if (prefs.loadBool("RememberWindowPosition")) {
        //            int width = prefs.loadInt("MainWindowWidth");
        //            int height = prefs.loadInt("MainWindowHeight");
        //            return new Dimension(width, height);
        //         }
        //      } catch (Exception ex) {
        //         // Ignore exception and continue with defaults
        //      }

        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        return new Dimension(4 * screenSize.width / 5, 4 * screenSize.height / 5);
    }//from   ww w  .  ja v a2s  . c  om
}

Related

  1. adjustPopupLocationToFitScreen(Component invoker, Dimension preferredSize, int xposition, int yposition)
  2. formatScreenSize(Dimension screenSize)
  3. getComponentWidthForResolution(int screenWidth, int desiredSize)
  4. getDefaultDeviceScreenSize()
  5. getDefaultMainFrameSize()
  6. getDefaultScreenBounds()
  7. getDefaultScreenDevice()