想要美化一下,固定窗口大小,选择背景图像及颜色,还有其他功能,还需要学习哪些JAVA知识点?求指教。
import java.awt.*;
import javax.swing.*;
public class guanli_chaozuo extends JFrame{
public JLabel jusername;
public JLabel jpassword,jpassword_sure;
public JTextField username;
public JPasswordField password,password_sure;
public JButton jb1,jb2;
public void make_GUI(){
jusername=new JLabel("用户名* ");
jpassword=new JLabel("新密码* ");
jpassword_sure=new JLabel("新密码确认*");
jb1=new JButton("确定");
jb2=new JButton("取消");
username=new JTextField(10);
password=new JPasswordField(10);
password_sure=new JPasswordField(10);
Container cp=getContentPane();
JPanel jp=new JPanel();
JPanel jp2 =new JPanel();
jp.setLayout(new GridLayout(4,8,20,10));
jp.add(jusername);jp.add(username);
jp.add(jpassword);jp.add(password);
jp.add(jpassword_sure);jp.add(password_sure);
jp2.add(jb1);
jp2.add(jb2);
cp.add(jp,BorderLayout.CENTER);
cp.add(jp2,BorderLayout.SOUTH);
setSize(300,200);
setVisible(true);
}
public guanli_chaozuo(String s){
super(s);
make_GUI();
}
public void exit(){
this.dispose();
}
}
|