Java Screen Size getMaxSize(Window frame)

Here you can find the source of getMaxSize(Window frame)

Description

get Max Size

License

Apache License

Declaration

public static Dimension getMaxSize(Window frame) 

Method Source Code

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

import java.awt.*;

public class Main {
    public static Dimension getMaxSize(Window frame) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        GraphicsConfiguration config = frame.getGraphicsConfiguration();
        Dimension availableScreenSize = new Dimension(toolkit.getScreenSize());
        Insets insets = toolkit.getScreenInsets(config);
        availableScreenSize.width -= (insets.left + insets.right);
        availableScreenSize.height -= (insets.top + insets.bottom);
        return availableScreenSize;
    }/*from ww w  . j ava2 s  . c  om*/

    private static Insets getScreenInsets(Window window) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        GraphicsConfiguration config = window.getGraphicsConfiguration();
        return toolkit.getScreenInsets(config);
    }
}

Related

  1. getLocalScreenBounds()
  2. getLocationFromMouse(Dimension panelPrefSize_)
  3. getMaximumWindowBounds()
  4. getMaximumWindowBounds()
  5. getMaximumWindowWidth()
  6. getMaxUsableScreenSize()
  7. getMaxWindowSize()
  8. getMinimumCacheSize(int tileSize, double overdrawFactor)
  9. getSizeWithScreen(double xd, double yd)