Java Screen Size getMaximumWindowBounds()

Here you can find the source of getMaximumWindowBounds()

Description

get Maximum Window Bounds

License

Open Source License

Declaration

public static Rectangle getMaximumWindowBounds() 

Method Source Code


//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);
    }
}

Related

  1. getDesktopBounds()
  2. getDesktopBounds()
  3. getLocalScreenBounds()
  4. getLocationFromMouse(Dimension panelPrefSize_)
  5. getMaximumWindowBounds()
  6. getMaximumWindowWidth()
  7. getMaxSize(Window frame)
  8. getMaxUsableScreenSize()
  9. getMaxWindowSize()