package javagetscreensize; import java.awt.Dimension; import java.awt.Toolkit; /** * * @web http://java-buddy.blogspot.com/ */ public class JavaGetScreenSize { public static void main(String[] args) { Toolkit myToolkit = Toolkit.getDefaultToolkit(); Dimension screenSize = myToolkit.getScreenSize(); int screenResolution = myToolkit.getScreenResolution(); System.out.println("Screen size = " + screenSize.width + " x " + screenSize.height); System.out.println("Screen Resolution: " + screenResolution + " dots-per-inch"); } }
Thursday, January 7, 2016
Get screen size and resolution, with java.awt.Toolkit
Java example to get screen size and resolution, with java.awt.Toolkit:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment