Editor editor=new Editor(); editor.setSize(700, 500); Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();//获取屏幕大小 int w = editor.getSize().width; int h =editor.getSize().height; int x = (dim.width-w)/2; int y = (dim.height-h)/2; editor.setLocation(x,y); editor.setVisible(true);
Editor editor=new Editor(); editor.setSize(700, 500); Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();//获取屏幕大小 int w = editor.getSize().width; int h =editor.getSize().height; int x = (dim.width-w)/2; int y = (dim.height-h)/2; editor.setLocation(x,y); editor.setVisible(true); =========================================================== 这是设置大小?
editor.setSize(700, 500);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();//获取屏幕大小
int w = editor.getSize().width;
int h =editor.getSize().height;
int x = (dim.width-w)/2;
int y = (dim.height-h)/2;
editor.setLocation(x,y);
editor.setVisible(true);
editor.setSize(700, 500);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();//获取屏幕大小
int w = editor.getSize().width;
int h =editor.getSize().height;
int x = (dim.width-w)/2;
int y = (dim.height-h)/2;
editor.setLocation(x,y);
editor.setVisible(true);
===========================================================
这是设置大小?