java.awt package
package app;
import java.awt.*;
public class Main
{
public static void main(String[] args)
{
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
for (GraphicsDevice gd : ge.getScreenDevices()) {
Rectangle rectangle = gd.getDefaultConfiguration().getBounds();
int width = (int) rectangle.getWidth();
int height = (int) rectangle.getHeight();
System.out.println(width + "x" + height);
}
}
}
Leave a Comment
Cancel reply