Here you can find the source of getMaximumWindowBounds()
public static Rectangle getMaximumWindowBounds()
//package com.java2s; //License from project: Open Source License import java.awt.*; import java.lang.reflect.Method; public class Main { public static Rectangle getMaximumWindowBounds() { final GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); try {/*from ww w.j ava 2 s . c om*/ final Method method = GraphicsEnvironment.class.getMethod("getMaximumWindowBounds", (Class[]) null); return (Rectangle) method.invoke(localGraphicsEnvironment, (Object[]) null); } catch (Exception e) { // ignore ... will fail if this is not a JDK 1.4 .. } final Dimension s = Toolkit.getDefaultToolkit().getScreenSize(); return new Rectangle(0, 0, s.width, s.height); } }