Toolkit: getScreenSize() : Toolkit « java.awt « Java by API






Toolkit: getScreenSize()

 
/*
 * Output:
Screen width = 1280
Screen height = 1024
 */

import java.awt.Dimension;
import java.awt.Toolkit;

public class MainClass {
  public static void main(String[] args) {
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension d = tk.getScreenSize();
    System.out.println("Screen width = " + d.width);
    System.out.println("Screen height = " + d.height);

  }
}

           
         
  








Related examples in the same category

1.Toolkit: addAWTEventListener(AWTEventListener listener, long eventMask)
2.Toolkit: createImage(byte[] img)
3.Toolkit: beep()
4.Toolkit: getColorModel()
5.Toolkit: getDefaultToolkit()
6.Toolkit: getImage(URL url)
7.Toolkit: getMenuShortcutKeyMask()
8.Toolkit: getProperty(String key, String def)
9.Toolkit: getScreenResolution()
10.Toolkit: getSystemClipboard()
11.Toolkit: getSystemEventQueue()
12.Toolkit: prepareImage(Image image, int width, int height, ImageObserver observer)