Does anyone know how you would get the screen width in java? I read something about some toolkit method but I'm not quite sure what that is.
Thanks, Andrew
To change display mode with Java Swings, use the setDisplayMode() method. Here, we have set the Display mode as: new DisplayMode(800, 600, 32, 60)); Now, when you will run the program, the frame would be visible in a different resolution than the actual set resolution of your system.
java.awt.Toolkit.getDefaultToolkit().getScreenSize()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With