标签:使用 io size ef on sp c height
//居中设置
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screenSize = toolkit.getScreenSize();
int x = (screenSize.width - frame.getWidth())/ 2;
int y= (screenSize.height - frame.getHeight())/ 2;
frame.setLocation(x , y);
JDK1.4后提供方法,建议使用
frame.setLocationRelativeTo(owner);
如果是主窗体,则
frame.setLocationRelativeTo(null);
标签:使用 io size ef on sp c height
原文地址:http://www.cnblogs.com/kingsy/p/3919758.html