基于java+mysql的swing+mysql物业收费系统(java+gui)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于java+mysql的Swing+MySQL物业收费系统(java+gui)
功能介绍:
用户登陆、用户注册、收费记录、生成业单、用户管理、查询缴费、历史账单、资料设置
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange()==e.SELECTED) {
if(willPayBox.getSelectedItem().toString().equals("暂无欠费业单")) {
payBtn.setBackground(Color.DARK_GRAY);
codeBtn.setBackground(Color.DARK_GRAY);
payBtn.setEnabled(false);// 没有欠费单的话 按钮无法使用
codeBtn.setEnabled(false);
fields[3].setText("您的物业费用已缴过费了!");
fields[4].setText("");
}else {
payBtn.setEnabled(true);
codeBtn.setEnabled(true);
String it=willPayBox.getSelectedItem().toString();
int payID=Integer.parseInt(it.substring(6, it.length()));
List<Payment> list = getNoPayList();
for(Payment np:list) {
if(np.getID()==payID) {
fields[3].setText("设备检查费:"+np.getCheckEXP()+"元 清洁费:"+np.getCleanEXP()+"元 停车费:"+np.getParkEXP());
fields[4].setText("总计:"+(np.getCheckEXP()+np.getCleanEXP()+np.getParkEXP())+"元");
}
}
}
}
}
};
return itemListener;
}
public JTextField[] getFields() {
return fields;
}
public void setFields(JTextField[] fields) {
this.fields = fields;
}
public JComboBox<String> getWillPayBox() {
return willPayBox;
}
public void setWillPayBox(JComboBox<String> willPayBox) {
this.willPayBox = willPayBox;
}
public List<Payment> getpList() {
return pList;
}
public void setpList(List<Payment> pList) {
this.pList = pList;
// }else {
// JOptionPane.showMessageDialog(null, "验证码为空或者无效", "注册失败", JOptionPane.ERROR_MESSAGE);
// }
}
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==sendBtn) {
// 点击注册按钮验证手机号
codeCheck();
}
}
private void codeCheck() {
if(phoneField.getText().matches(regexCh)) {
timer.schedule(new TimerTask() {
int i = 60;
@Override
public void run() {
sendBtn.setEnabled(false);
i--;
sendBtn.setText(i + "s");
sendBtn.setForeground(Color.white);
//sendBtn.setHorizontalTextPosition(JButton.CENTER);
if (i <= 0) {
//设置按钮可点击 并且停止任务
sendBtn.setEnabled(true);
sendBtn.setText("验证码");
//sendBtn.setHorizontalTextPosition(JButton.CENTER);
timer.cancel();
}
}
}, 0, 1000);
//验证手机号
String phonemsg = PhoneCode.getPhonemsg(phoneField.getText(),0);
codeString=PhoneCode.codeNum;
if(!phonemsg.equals("true")) {
JOptionPane.showMessageDialog(null, phonemsg);
}
}else {
JOptionPane.showMessageDialog(null,"电话号码不合法!","警告",JOptionPane.WARNING_MESSAGE);
}
}
public KeyAdapter getKeyAdapter() {
KeyAdapter keyAdapter=new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
int keyChar=e.getKeyChar();
if(e.getSource()==field|e.getSource()==passwordField){
}
}
};
return keyAdapter;
}
}
public class PhoneCode {
private static String code ;
public static String codeNum ;
/**
* 阿里云短信服务配置
* @param mobile
* @return
*/
public static String getPhonemsg(String mobile,int mode) {
/**
// * 进行正则关系校验
// */
// //System.out.println(mobile);
// if (mobile == null || mobile == "") {
// System.out.println("手机号为空");
// return "";
// }
// /**
// * 短信验证---阿里大于工具
add(this.payBtnSetting());
add(this.codeBtnSetting());
}
public UserPaneSon1(User user) {
this();
this.user=user;
fields[0].setText("*"+user.getName());
fields[1].setText("*"+user.getPhone());
add(this.initBox());
}
public JLabel[] initJLabels(JLabel[] L,int length) {
String[] text= {"姓名:","手机号:","验证码:","待付费:"};
L=new JLabel[length];
for (int i = 0; i < L.length; i++) {
L[i]=new JLabel(text[i]);
L[i].setFont(font);
L[i].setHorizontalAlignment(JLabel.RIGHT);
L[i].setBounds(280,100+60*i,80,40);
}
return L;
}
public JTextField[] iniTextField(JTextField[] vFields,int length) {
vFields=new JTextField[length];
for (int i = 0; i < vFields.length; i++) {
vFields[i]=new JTextField();
if(i!=2&i!=3&i!=4)
vFields[i].setBounds(380, 100+60*i, 200, 40);
vFields[i].setFont(fontField);
if(i!=2) {
vFields[i].setEditable(false);
}
}
vFields[2].setBounds(380, 220, 100, 40);
vFields[3].setBounds(540, 280, 250, 40);
vFields[4].setBounds(480, 340, 150, 40);
vFields[3].setBorder(null);
vFields[3].setBackground(null);
vFields[4].setBorder(null);
vFields[4].setBackground(null);
private JTextField phoneField;
private JTextField keyField;
private JPasswordField passwordField;
private JTextArea textArea;
@SuppressWarnings("unused") // 暂时去掉小黄警告
private JButton submitBtn,sendBtn;
private JComboBox< String > box;
private User registUser;
private static String codeString="";
String regexCh = "^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$";
Timer timer=new Timer();
public RegistListener(RegistUI registUI, JTextField nameField,JTextField field, JTextField phoneField, JTextField keyField,
JPasswordField passwordField, JTextArea textArea, JButton submitBtn,
JButton sendBtn, JComboBox<String> box) {
super();
this.registUI = registUI;
this.nameField=nameField;
this.field = field;
this.phoneField = phoneField;
this.keyField = keyField;
this.passwordField = passwordField;
this.textArea = textArea;
this.submitBtn = submitBtn;
this.sendBtn = sendBtn;
this.box = box;
}
@Override
public void mouseClicked(MouseEvent e) {
String userNameString = field.getText();
String pwdString = new String (passwordField.getPassword());
String nameString = nameField.getText();
String phoneString = phoneField.getText();
String userTypeString = box.getSelectedItem().toString();
String infoString = textArea.getText();
if(userNameString.length()*pwdString.length()*nameString.length()*phoneString.length()*userTypeString.length()==0) {
JOptionPane.showMessageDialog(null, "请将所有信息完善", "注册失败", JOptionPane.ERROR_MESSAGE);
}else {
// if(codeString.equals(keyField.getText())&codeString.length()!=0) {
private List<Payment> payList=new ArrayList<Payment>();
private Object[][] data;
// 无参构造 局部测试用
public UserPaneSon2() {
super(null);
setBounds(0, 0, 900, 590);
setBackground(Color.WHITE);
}
// 有参构造 总体测试用
public UserPaneSon2(User user) {
this();
this.user=user;
add(initScrollPane(this.getPayments(this.user)));
this.delBtn=this.initJButton(delBtn, "删除记录", 750, 520);
add(this.delBtn);
}
private JScrollPane initScrollPane(List<Payment> list) {
jScrollPane=new JScrollPane();
jScrollPane.setBackground(Color.WHITE);
jScrollPane.setBounds(0, 0, 896, 500);
jScrollPane.setViewportView(getViewtable(list));
return jScrollPane;
}
private JTable getViewtable(List<Payment> list) {
data=new Object[list.size()][];
int i=0;
for(Payment p:list) {
data[i++]=setArrObj(p);
}
dtm=new DefaultTableModel(data,columnNames);
payedTable=new JTable(dtm) {
private static final long serialVersionUID = -111L;
// 重写这个表格的方法:设置不可编辑,但可以选中
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
uTabbedPane.addTab("jPanel01", jPanel01); //添加选项卡容器,并且设置其中每个选项卡的标签以及其是否可启用
uTabbedPane.setEnabledAt(0, true);
uTabbedPane.setTitleAt(0, "查询缴费");
uTabbedPane.addTab("jPanel02", jPanel02); //添加选项卡容器,并且设置其中每个选项卡的标签以及其是否可启用
uTabbedPane.setEnabledAt(1, true);
uTabbedPane.setTitleAt(1, "历史账单");
uTabbedPane.addTab("jPanel03", jPanel03); //添加选项卡容器,并且设置其中每个选项卡的标签以及其是否可启用
uTabbedPane.setEnabledAt(2, true);
uTabbedPane.setTitleAt(2, "资料设置");
uTabbedPane.setUI(new TabbedPaneDef());
uTabbedPane.setBounds(0, 60, 900, 640);
uTabbedPane.setFont(new Font("宋体", Font.BOLD, 18));
uTabbedPane.setForeground(new Color(255,255,255));
paneSon1=new UserPaneSon1(user);
jPanel01.add(paneSon1);
paneSon2=new UserPaneSon2(user);
jPanel02.add(paneSon2);
paneSon3=new UserPaneSon3(user);
paneSon3.setOwner(this);
jPanel03.add(paneSon3);
return uTabbedPane;
}
public JPanel getjPanel01() {
return jPanel01;
}
public void setjPanel01(JPanel jPanel01) {
this.jPanel01 = jPanel01;
}
public JPanel getjPanel02() {
return jPanel02;
}
public void setjPanel02(JPanel jPanel02) {
this.jPanel02 = jPanel02;
public class UserDAOImp extends AdapterDAO{
DataSource dataSource=DruidJDBC.getDataSource();
JdbcTemplate jt=new JdbcTemplate(dataSource);
String sql;
@Override
public List<User> getRightPost(String userName, String password){
// TODO Auto-generated method stub
sql="select * from user where userName = ? and userPassword = ?";
List<User> user=null;
user = jt.query(sql, new BeanPropertyRowMapper<User>(User.class),userName,password);
return user;
}
@Override
public int insertObj(List<?> list) throws SQLException {
// TODO Auto-generated method stub
int count=0;
if(list.size()==0) {
return count;
}
sql="insert into user(userName,userPassword,name,phone,userType,advDeposit,place,available) values(?,?,?,?,?,?,?,?)";
try {
for(Object one:list) {
User user=(User) one;
PreparedStatement pS = DruidJDBC.getConnection().prepareStatement("select * from user where userName=? or phone=?");
pS.setString(1, user.getUserName());
pS.setString(2, user.getPhone());
ResultSet rs = pS.executeQuery();
if(rs.next()==true) {
return -1;
}else {
count+=jt.update(sql, user.getUserName(),user.getUserPassword(),user.getName(),user.getPhone(),
user.getUserType(),"10000",user.getPlace(),user.getAvailable());
}
}
}catch (DuplicateKeyException e) {
return -1;// 表示表中已存在字段唯一属性的记录 -> 标志用户已存在
}
return count;
}
@Override
public List<?> selectAll() {
sql="select * from user";
List<User> list = jt.query(sql, new BeanPropertyRowMapper<User>(User.class));
return list;
}
@SuppressWarnings("unchecked")
@Override
public void delete(List<?> list) {
if (list.size()<=0) {
this.addBtn=new JButton("添 加");
this.modBtn=new JButton("修 改");
this.dellBtn=new JButton("删 除");
refleshBtn.setBounds(40, 20, 100, 40);
addBtn.setBounds(150, 20, 100, 40);
modBtn.setBounds(260, 20, 100, 40);
dellBtn.setBounds(370, 20, 100, 40);
refleshBtn.setBorder(null);
addBtn.setBorder(null);
modBtn.setBorder(null);
dellBtn.setBorder(null);
refleshBtn.setFocusPainted(false);
addBtn.setFocusPainted(false);
modBtn.setFocusPainted(false);
dellBtn.setFocusPainted(false);
addBtn.setBackground(new Color(22, 141, 90));
refleshBtn.setBackground(new Color(138, 41, 48));
dellBtn.setBackground(new Color(219,81,69));
modBtn.setBackground(new Color(191, 230, 230));
addBtn.setForeground(Color.white);
modBtn.setForeground(Color.white);
dellBtn.setForeground(Color.white);
refleshBtn.setForeground(Color.white);
refleshBtn.setFont(new Font("",Font.PLAIN,16));
addBtn.setFont(new Font("",Font.PLAIN,16));
modBtn.setFont(new Font("",Font.PLAIN,16));
dellBtn.setFont(new Font("",Font.PLAIN,16));
modBtn.setToolTipText("管理员是不能修改账单的!");
modBtn.setEnabled(false);
floorPanel.setBounds(0, 500, 900, 88);
floorPanel.setBackground(Color.WHITE);
floorPanel.add(refleshBtn);
floorPanel.add(addBtn);
floorPanel.add(modBtn);
floorPanel.add(dellBtn);
return floorPanel;
}
public JPanel initJpanel02() {
JPanel jPanel=new JPanel();
return jPanel;
}
public MasterListener getMasterListener() {
return masterListener;
}
public class UserPaneSon3 extends JPanel{
private static final long serialVersionUID = -1804L;
private User user;
private JScrollPane jScrollPane;
private JTable vtable;
private DefaultTableModel dtm;
private String[] columnNames = {"资料","详细信息"};
private Object[][] data;
private UserUI owner;
public UserPaneSon3() {
super(null);
setBounds(0, 0, 900, 590);
setBackground(Color.WHITE);
add(initScrollPane());
dtmListener();
}
public UserPaneSon3(User user) {
super(null);
this.user=user;
setBounds(0, 0, 900, 590);
setBackground(Color.WHITE);
add(initScrollPane());
dtmListener();
}
private JScrollPane initScrollPane() {
jScrollPane=new JScrollPane();
jScrollPane.setBackground(Color.WHITE);
jScrollPane.setBounds(200, 50, 500, 349);
jScrollPane.setViewportView(getViewtable());
return jScrollPane;
}
@SuppressWarnings("serial")
private JTable getViewtable() {
data=createArr();
dtm=new DefaultTableModel(data,columnNames);
vtable=new JTable(dtm) {
// 重写这个表格的方法:设置不可编辑,但可以选中
@Override
public class RegistListener extends MouseAdapter implements ActionListener{
private RegistUI registUI;
private JTextField nameField;
private JTextField field;
private JTextField phoneField;
private JTextField keyField;
private JPasswordField passwordField;
private JTextArea textArea;
@SuppressWarnings("unused") // 暂时去掉小黄警告
private JButton submitBtn,sendBtn;
private JComboBox< String > box;
private User registUser;
private static String codeString="";
String regexCh = "^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$";
Timer timer=new Timer();
public RegistListener(RegistUI registUI, JTextField nameField,JTextField field, JTextField phoneField, JTextField keyField,
JPasswordField passwordField, JTextArea textArea, JButton submitBtn,
JButton sendBtn, JComboBox<String> box) {
super();
this.registUI = registUI;
this.nameField=nameField;
this.field = field;
this.phoneField = phoneField;
this.keyField = keyField;
this.passwordField = passwordField;
this.textArea = textArea;
this.submitBtn = submitBtn;
this.sendBtn = sendBtn;
this.box = box;
}
@Override
public void mouseClicked(MouseEvent e) {
String userNameString = field.getText();
String pwdString = new String (passwordField.getPassword());
Date d=new Date();
c.setTime(d);//设置指定时间
int year=c.get(Calendar.YEAR);
int month=c.get(Calendar.MONTH)+1; //默认是0-11,我国是1-12
int day=c.get(Calendar.DAY_OF_MONTH);
return year+"/"+month+"/"+day;
}
public JTabbedPane initJTabbedPane() {
uTabbedPane=new JTabbedPane();
jPanel01=new JPanel(null);
jPanel02=new JPanel(null);
jPanel03=new JPanel(null);
jPanel01.setBackground(color);
jPanel02.setBackground(color);
jPanel03.setBackground(color);
uTabbedPane.addTab("jPanel01", jPanel01); //添加选项卡容器,并且设置其中每个选项卡的标签以及其是否可启用
uTabbedPane.setEnabledAt(0, true);
uTabbedPane.setTitleAt(0, "查询缴费");
uTabbedPane.addTab("jPanel02", jPanel02); //添加选项卡容器,并且设置其中每个选项卡的标签以及其是否可启用
uTabbedPane.setEnabledAt(1, true);
uTabbedPane.setTitleAt(1, "历史账单");
uTabbedPane.addTab("jPanel03", jPanel03); //添加选项卡容器,并且设置其中每个选项卡的标签以及其是否可启用
uTabbedPane.setEnabledAt(2, true);
uTabbedPane.setTitleAt(2, "资料设置");
uTabbedPane.setUI(new TabbedPaneDef());
uTabbedPane.setBounds(0, 60, 900, 640);
uTabbedPane.setFont(new Font("宋体", Font.BOLD, 18));
uTabbedPane.setForeground(new Color(255,255,255));
paneSon1=new UserPaneSon1(user);
jPanel01.add(paneSon1);
paneSon2=new UserPaneSon2(user);
jPanel02.add(paneSon2);
paneSon3=new UserPaneSon3(user);
paneSon3.setOwner(this);
jPanel03.add(paneSon3);
return uTabbedPane;
}
public JPanel getjPanel01() {
return jPanel01;
return clearButton;
}
public void setClearButton(JButton clearButton) {
this.clearButton = clearButton;
}
public JComboBox<String> getPayBox() {
return payBox;
}
public void setPayBox(JComboBox<String> payBox) {
this.payBox = payBox;
}
public JTextField getField01() {
return field01;
}
public void setField01(JTextField field01) {
this.field01 = field01;
}
public JTextField getField02() {
return field02;
}
public void setField02(JTextField field02) {
this.field02 = field02;
}
public JTextField getField03() {
return field03;
}
public void setField03(JTextField field03) {
this.field03 = field03;
}
public JTextField getField04() {
return field04;
}
public void setField04(JTextField field04) {
this.field04 = field04;
}
public JTextField getInfoField01() {
return infoField01;
}
public void setInfoField01(JTextField infoField01) {
this.infoField01 = infoField01;
}
public JTextField getInfoField02() {
return infoField02;
}
public void setInfoField02(JTextField infoField02) {
this.infoField02 = infoField02;
}
public JTextField getInfoField03() {
return infoField03;
}
public void setInfoField03(JTextField infoField03) {
this.infoField03 = infoField03;
}
if(i!=2&i!=3&i!=4)
vFields[i].setBounds(380, 100+60*i, 200, 40);
vFields[i].setFont(fontField);
if(i!=2) {
vFields[i].setEditable(false);
}
}
vFields[2].setBounds(380, 220, 100, 40);
vFields[3].setBounds(540, 280, 250, 40);
vFields[4].setBounds(480, 340, 150, 40);
vFields[3].setBorder(null);
vFields[3].setBackground(null);
vFields[4].setBorder(null);
vFields[4].setBackground(null);
JTextField field=new JTextField();
field.setBounds(585, 220, 200, 40);
field.setBorder(null);
field.setBackground(null);
field.setEditable(false);
KeyAdapter adapter=new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
int keyChar=e.getKeyChar();
if(!(new String(((char)keyChar)+"").matches("^[0-9]+$"))){
field.setText("*检测到写非数字字符自动删除");
field.setForeground(Color.RED);
e.consume();
}else {
field.setText("");
}
}
};
this.add(field);
vFields[2].addKeyListener(adapter);
return vFields;
}
public JButton payBtnSetting() {
this.payBtn=new JButton("支 付");
payBtn.setBounds(380, 420, 200, 50);
payBtn.setBorder(null);
payBtn.setFocusPainted(false);
payBtn.setBackground(new Color(103,172,80));
payBtn.setForeground(Color.white);
payBtn.setFont(fontField);
return payBtn;
}
public JButton codeBtnSetting() {
JLabel jLabel=new JLabel("手机号验证:");
jLabel.setBounds(75, 70, 100, 40);
jLabel.setFont(new Font("",Font.PLAIN,16));
String phone = ((UserUI)owner).getUser().getPhone();
field01=new JTextField();
field01.setBounds(185, 70, 140, 40);
field01.setText(phone);
field01.setEditable(false);
field01.setBackground(null);
field01.setFont(new Font("",Font.PLAIN,16));
JLabel jLabel2=new JLabel("获取验证码:");
jLabel2.setBounds(75, 130, 100, 40);
jLabel2.setFont(new Font("",Font.PLAIN,16));
field02=new JTextField();
field02.setBounds(185, 130, 70, 40);
field02.setBackground(null);
field02.setFont(new Font("",Font.PLAIN,16));
button01=new JButton("发送");
button01.setBounds(260, 130, 65, 40);
button01.setBorder(null);
button01.setFocusPainted(false);
button01.setBackground(new Color(133, 162, 190));
button01.setForeground(Color.white);
button02=new JButton("确 认");
button02.setBounds(80, 200, 95, 40);
button02.setBorder(null);
button02.setFocusPainted(false);
button02.setBackground(new Color(103, 162, 100));
button02.setForeground(Color.white);
button03=new JButton("取 消");
button03.setBounds(220, 200, 95, 40);
button03.setBorder(null);
button03.setFocusPainted(false);
button03.setBackground(new Color(193, 162, 100));
button03.setForeground(Color.white);
dialog.add(jLabel);
public class LoginListener implements ActionListener{
private JFrame loginUI;
private JTextField userNameField;
private JPasswordField passwordField;
private JComboBox<String> box;
private JButton logButton,minButton,closeButton;
private JPanel headPanel ;
private JButton registButton;
private JButton forgetButton;
private int mouseAtX = 0;
private int mouseAtY = 0;
public LoginListener() {
super();
}
public LoginListener(JFrame loginUI,JTextField userNameField, JPasswordField passwordField, JComboBox<String> box,
JButton logButton, JButton minButton, JButton closeButton, JPanel headPanel, JButton registButton,
JButton forgetButton) {
super();
this.loginUI=loginUI;
this.userNameField = userNameField;
this.passwordField = passwordField;
this.box = box;
this.logButton = logButton;
this.minButton = minButton;
this.closeButton = closeButton;
this.headPanel = headPanel;
this.registButton = registButton;
this.forgetButton = forgetButton;
this.canDraged(this.headPanel);
}
// 窗体可拖拽
public void canDraged(JPanel p) {
public class MasterUI extends JFrame{
private static final long serialVersionUID = -18044L;
Color color=new Color(191,230,240);
private Master master=null;
private List<Payment> lists;
private JPanel headPanel;
private JPanel jPanel01,jPanel02,jPanel03;
private JPanel floorPanel;
private JTabbedPane allTabbedPane;
private JScrollPane payScrollPane;
private JTable payJTable=null;
private JButton refleshBtn,addBtn,modBtn,dellBtn;
private JButton miniBtn,closeBtn;
private String[] columnNames = { "编号","用户名", "检修费", "清洁费", "停车费", "缴费日期","是否缴费" };
private MasterListener masterListener;
private MasterPaneSon1 masterPaneSon1=new MasterPaneSon1();
private MasterPaneSon2 masterPaneSon2=new MasterPaneSon2();
private MasterPaneSon2 masterPaneSon2=new MasterPaneSon2();
Object[][] data;
public MasterUI() throws HeadlessException {
setSize(900, 700);
setLayout(null);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().setBackground(color);
setUndecorated(true);
setResizable(false);
initHeadPane();
add(initJTabbedPane());
this.masterListener = new MasterListener(this,allTabbedPane,payJTable,headPanel
, refleshBtn, addBtn, modBtn, dellBtn,miniBtn,closeBtn,masterPaneSon1,masterPaneSon2);
setVisible(true);
}
public MasterUI(Master master) throws HeadlessException {
this.master = master;
setSize(900, 700);
setLayout(null);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().setBackground(color);
setUndecorated(true);
setResizable(false);
initHeadPane();
add(initJTabbedPane());
this.masterListener = new MasterListener(this,allTabbedPane,payJTable,headPanel
, refleshBtn, addBtn, modBtn, dellBtn,miniBtn,closeBtn,masterPaneSon1,masterPaneSon2);
setVisible(true);
}
public void initHeadPane() {
headPanel=new JPanel(null);
headPanel.setBounds(0, 0, 900, 60);
headPanel.setBackground(Color.white);