Toolkit#getScreenResolution method return the screen resolution in dots-per-inch.
ScreenResolutionDotsPerInchDemo.java
package com.sample.app.awtprograms;
import java.awt.Toolkit;
public class ScreenResolutionDotsPerInchDemo {
public static void main(String args[]) {
int screenResolution = Toolkit.getDefaultToolkit().getScreenResolution();
System.out.println("screen resolution in dots-per-inch : " + screenResolution);
}
}
Output
screen resolution in dots-per-inch : 129
No comments:
Post a Comment