QqChat:
聊天界面布局:
组件有:一个JTextField,一个JTextArea,一个JButton,一个JPanel;
JTextArea 放在北边。JTextField和JButton,放在南边的Jpanel里面。
public QqChat(){
jta=new JTextArea();
jtf=new JTextField(15);
jbu=new JButton("发送");
jp= new JPanel();
jp.add(jtf);
jp.add(jbu);
this.add(jta,"Center");
this.add(jp,"South");
this.setIconImage(new ImageIcon("image/qq.gif").getImage());
this.setSize(400,400);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(3);
this.setVisible(true);