import java.awt.*;
public class screenDim {
public static void main(String[] args) {
try{
Toolkit newTollKit=Toolkit.getDefaultToolkit();
Dimension screenDim=newTollKit.getScreenSize();
System.out.println("Screen height in pixels: "+screenDim.height);
System.out.println("Screen width in pixels: "+screenDim.width);
}
catch(Exception e){
e.printStackTrace();
}
}
}
public class screenDim {
public static void main(String[] args) {
try{
Toolkit newTollKit=Toolkit.getDefaultToolkit();
Dimension screenDim=newTollKit.getScreenSize();
System.out.println("Screen height in pixels: "+screenDim.height);
System.out.println("Screen width in pixels: "+screenDim.width);
}
catch(Exception e){
e.printStackTrace();
}
}
}
Comments