Java Toolkit.getScreenResolution()
Syntax
Toolkit.getScreenResolution() has the following syntax.
public abstract int getScreenResolution() throws HeadlessException
Example
In the following code shows how to use Toolkit.getScreenResolution() method.
import java.awt.Toolkit;
/* w w w . j av a2 s . c om*/
public class Main {
public static void main(String[] args) {
Toolkit tk = Toolkit.getDefaultToolkit();
System.out.println("Screen resolution = " + tk.getScreenResolution());
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »