public static Dimension getScreenDimension ( Component component ) { int screenID = getScreenID ( component ) ; Dimension dimension = new Dimension ( 0 , 0 ) ; GraphicsEnvironment ge = GraphicsEnvironment . getLocalGraphicsEnvironment ( ) ; GraphicsConfiguration defaultConfiguration = ge . getScreenDevices ( ) [ screenID ] . getDefaultConfiguration ( ) ; Rectangle rectangle = defaultConfiguration . getBounds ( ) ; dimension . setSize ( rectangle . getWidth ( ) , rectangle . getHeight ( ) ) ; return dimension ; }
Gets the screen dimension .