Swing之JFrame窗体

 

 

 

 

 1 public class JFrameDemo extends  JFrame{
 2     public  void init() {
 3         JFrame jf = new JFrame("guoguoguo");
 4 //获得一个容器
 5         Container container=  jf.getContentPane();
 6         container.setBackground(Color.red);
 7         jf.setBounds(200, 200, 400, 500);
 8         jf.setVisible(true);
 9         Label label = new Label("hahahahahahahh");
10         jf.add(label);
11         jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
12 
13 
14     }

 

posted on 2022-08-05 23:51  大风吹过12138  阅读(11)  评论(0)    收藏  举报

导航