To obtain the current screen size requires interfacing with the native window system. The Java AWT library allows this
through the
Toolkit class. You will be using:
Toolkit.getDefaultToolkit()
getScreenSize()
===============================================================
import java.awt.*;
public final class ScreenSize {
public static final void main(String[] args) {
Dimension size;
size = Toolkit.getDefaultToolkit().getScreenSize();
System.out.println("Width: " + size.width + " Height: " + size.height);
System.exit(0);
}
}