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

后端 未结 5 1133
失恋的感觉
失恋的感觉 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 20:08

    Apart from Hovercrafts's suggestion you might consider a background thread that checks the current screen resolution using Toolkit.getScreenSize().

    You would need to test this to find out how big the performance impact of that thread to the system is. How often it checks for changes depends on your requirements (how quick your application needs to react to the change)

提交回复
热议问题