import java.awt.Dimension;
import java.awt.Toolkit;
public class GetScreenSizeExample2 {
public static void main(String... args) {
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
int screenHeight = dimension.height;
int screenWidth = dimension.width;
System.out.println("Height: " + screenHeight);
System.out.println("Width: " + screenWidth);
}
}