Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道setLocationRelativeTo(null)使 GUI 居中的操作,但我希望它偏离中心,因为我的两个 GUI 大小相同,我希望用户知道他们已经打开了一个新窗口,在此先感谢
setLocationRelativeTo(null)
考虑使用setLocationByPlatform(boolean locationByPlatform).
setLocationByPlatform(boolean locationByPlatform)
有关演示,请参阅如何以最佳方式定位 Swing GUI 。