import java.awt.*;
import javax.swing.*;
public class Demo11 extends JFrame{
JTextArea jta=null;
JScrollPane jsp=null;
JPanel jp1=null;
JComboBox jcb=null;
JTextField jtf=null;
JButton jb=null;
public static void main(String[] args) {
// TODO Auto-generated method stub
Demo11 demo11=new Demo11();
}
public Demo11()
{
jta=new JTextArea();
jsp=new JScrollPane(jta);
jp1=new JPanel();
String []chatter={"布什","拉登"};
jcb=new JComboBox(chatter);
jtf=new JTextField(10);
jb=new JButton("发送");
jp1.add(jcb);
jp1.add(jtf);
jp1.add(jb);
this.add(jsp);
this.add(jp1,BorderLayout.SOUTH);
ImageIcon icon=new ImageIcon("icon.jpg");
icon.getImage().flush();
this.setIconImage(icon.getImage());
this.setTitle("简易聊天界面");
this.setSize(400,400);
this.setLocation(400, 400);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
this.setResizable(false);
}
}
你看看人家的例子,
就是为窗口更换图片
这个不好说不是一时半刻的事