如标题,请各位高手指教指教
谢谢!!

解决方案 »

  1.   

    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;public class Test extends JWindow
    {
    public static void main(String s[])
    {
    Test n = new Test();
    JButton exit = new JButton("Exit");
    n.setBounds(100,100,400,400);

    n.getContentPane().add(new JLabel("This is test"), BorderLayout.NORTH);
    n.getContentPane().add(exit, BorderLayout.SOUTH);

    exit.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e)
    {
    System.exit(0);
    }
    });

    n.show();

    }

    }
      

  2.   

    实现最大化,或者是最小化窗口
       setExtendedState(MAXIMIZED_BOTH);
       setExtendedState(ICONIFIED);