@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
		//ť¼
		if (e.getSource() == queryButton) {
			String jtfValue = queryTextField.getText().trim();
			//ѯʱǿַѯ
			if (jtfValue.equals("")) {
				String sql = "select * from tb_student where 1=?";
				String[] params = new String[] {"1"};
				model = new StudentBiz();
				model.queryStudent(sql, params);
				jTableInfo.setModel(model);
			} else {
				//ѯʱַ
				String sql = "select * from tb_student where stuName=?";
				String[] params = new String[] {jtfValue};
				model = new StudentBiz();
				model.queryStudent(sql, params);
				jTableInfo.setModel(model);
			}
		}
		//Ӱť¼
		//ǲ˵еӰť򹤾еĵײеӰť
		else if (e.getSource() == addButton || e.getSource() == mItem1 || e.getSource() == jButton1 ) {
			AddStudent addStudent = new AddStudent(this, "ѧ", true);		//Ի
			String sql = "select * from tb_student where 1=?";
			String[] params = new String[] {"1"};
			model = new StudentBiz();
			model.queryStudent(sql, params);
			jTableInfo.setModel(model);
		}
		//޸İť¼
		else if (e.getSource() == updateButton || e.getSource() == mItem2 || e.getSource() == jButton2 ) {
			//ȡѡе
			int rowNum = this.jTableInfo.getSelectedRow();
			System.out.println(rowNum);
			if (rowNum == -1) {
				JOptionPane.showMessageDialog(this, "ѡһ޸");
				return;
			} else {
				UpdateStudent updateStudent = new UpdateStudent(this, "޸ѧϢ", true, model,rowNum);
				model = new StudentBiz();
				String sql = "select * from tb_student where 1=?";
				String[] params = new String[] {"1"};
				model.queryStudent(sql, params);
				jTableInfo.setModel(model);
			}
		}
		//ɾť¼
		else if (e.getSource() == deleteButton || e.getSource() == mItem3 || e.getSource() == jButton3 ) {
			//ȡѡе
			int rowNum = this.jTableInfo.getSelectedRow();
			System.out.println(rowNum);
			if (rowNum == -1) {
				JOptionPane.showMessageDialog(this, "ѡһ޸");
				return;
			} else {
				String sql = "delete from tb_student where stuId=?";
				String stuId =(String)this.jTableInfo.getValueAt(rowNum, 0);
				String[] params = new String[] {stuId};
				StudentBiz myModel = new StudentBiz();
				myModel.updateStu(sql, params);				//ִɾ
				
				//»µģ
				model = new StudentBiz();
				String sql2 = "select * from tb_student where 1=?";
				String[] params2 = new String[] {"1"};
				model.queryStudent(sql2, params2);
				jTableInfo.setModel(model);
			}
		}
	}