java中设置了弹出窗体的当前窗体大小,但就是没有效果.哪位大虾可以帮帮忙啊.谢谢.

解决方案 »

  1.   

    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);
      

  2.   

    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);
    ===========================================================
    这是设置大小?
      

  3.   

    汗 没看到editor.setSize(700, 500); 不好意思