I have a Java app that launches, creates a GUI and works great. If the user changes the screen resolution (switches from 1440x900 to 1280x768), I\'d like to be able to list
You can create a global PAINT listener to detect screen resize.
// screen resize listener
Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
@Override
public void eventDispatched(AWTEvent event) {
// take a look at http://stackoverflow.com/questions/10123735/get-effective-screen-size-from-java
Rectangle newSize = getEffectiveScreenSize();
if (newSize.width != windowSize.width || newSize.height != windowSize.height)
resize();
}
}, AWTEvent.PAINT_EVENT_MASK);