Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screen = toolkit.getScreenSize();
x = (screen.width - this.getWidth()) / 2;
y = (screen.height - this.getHeight() - 20) / 2;
转载于:https://blog.51cto.com/zchuanzhao/1281240
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screen = toolkit.getScreenSize();
x = (screen.width - this.getWidth()) / 2;
y = (screen.height - this.getHeight() - 20) / 2;
转载于:https://blog.51cto.com/zchuanzhao/1281240