Toolkit: getScreenSize() : Toolkit : java.awt : Java by API examples (example source code) Organized by topic

Java by API
C++
PHP
Java by API Home »  java.awt   » [  Toolkit  ]   
 



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: createImage(byte[] img)
2.  Toolkit: beep()
3.  Toolkit: getColorModel()
4.  Toolkit: getDefaultToolkit()
5.  Toolkit: getImage(URL url)
6.  Toolkit: getMenuShortcutKeyMask()
7.  Toolkit: getProperty(String key, String def)
8.  Toolkit: getScreenResolution()
9.  Toolkit: getSystemClipboard()
10.  Toolkit: getSystemEventQueue()
11.  Toolkit: prepareImage(Image image, int width, int height, ImageObserver observer)
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.