Here you can find the source of getDefaultAppSize()
public static Dimension getDefaultAppSize()
//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 }