Java Graphics Environment getDesktopSize()

Here you can find the source of getDesktopSize()

Description

get Desktop Size

License

BSD License

Return

the size of the user's desktop

Declaration

public static Dimension getDesktopSize() 

Method Source Code

//package com.java2s;
/**/*w w  w . j  a va2  s  . c o  m*/
 * <p>
 * This class contains useful methods for positioning, sizing, and manipulating JFrames and other
 * Window-like elements.
 * </p>
 * <p>
 * <span class="BSDLicense"> This software is distributed under the <a
 * href="http://hci.stanford.edu/research/copyright.txt">BSD License</a>. </span>
 * </p>
 * 
 * @author <a href="http://graphics.stanford.edu/~ronyeh">Ron B Yeh</a> (ronyeh(AT)cs.stanford.edu)
 */

import java.awt.*;

public class Main {
    private static Rectangle desktopBounds = new Rectangle(0, 0, 640, 480);

    /**
     * @return the size of the user's desktop
     */
    public static Dimension getDesktopSize() {
        return desktopBounds.getSize();
    }
}

Related

  1. getDefaultGraphicsConfig()
  2. getLocalGraphicsEnvironment()
  3. getMaximumWindowBounds()
  4. getMaximumWindowDimension()
  5. getMenuShortCutKeyMask()