Win.toFront();//这样弹出窗口不会在最前吗?
Win.show();
这两条应该交换下位置:
Win.show();
Win.toFront();
就可以实现在最前,toFront() 的前提是 the Window is visible

解决方案 »

  1.   

    至于按纽的大小,有两种方法可以设:setBounds(int x,int y,int width,int height)setSize(int width,int height)
      

  2.   

    resize(int width,int height)
      

  3.   

    Win.toFront();只能在当前窗口中提前显示按纽的大小,如果你要改其大小的话可以用
    JButton button =new JButton("hello"){
       public Dimension getPreferredSize(){
    return new Dimension(300,100);//随便你设置
       }
    };