Detect screen resolution change made by user (Java Listener?)

后端 未结 5 1131
失恋的感觉
失恋的感觉 2021-01-17 19:17

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

5条回答
  •  伪装坚强ぢ
    2021-01-17 19:56

    I don't think that Java can do this by itself. You would have to have a "hook" into the operating system that detects this change and may wish to consider using JNA, JNI, or a separate utility such as perhaps Sigar that reports to your Java program. Out of curiosity, why do you wish to do this? Is it for a game you're making or so that you can re-size a GUI application?

提交回复
热议问题