package org.kodejava.awt;
import java.awt.*;
public class ScreenSizeExample {
public static void main(String[] args) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
System.out.println("Screen Width: " + screenSize.getWidth());
System.out.println("Screen Height: " + screenSize.getHeight());
}
}
The output of the code snippet above:
Screen Width: 2560.0
Screen Height: 1080.0
Latest posts by Wayan (see all)
- How do I get number of each day for a certain month in Java? - September 8, 2024
- How do I get operating system process information using ProcessHandle? - July 22, 2024
- How do I sum a BigDecimal property of a list of objects using Java Stream API? - July 22, 2024