}
}
public static void main(String[] args) { }
new EnterStudentFrm_disp_score();
package project; import javax.swing.*; import java.awt.*; import java.awt.event.*;
public class EnterStudentFrm_modify_info extends JFrame implements ActionListener{
public void actionPerformed(ActionEvent e) { }
if (e.getSource() == btn_add) { }
String sno=txt_sno.getText(); if(studentDao.isExist(sno)){ }
else JOptionPane.showMessageDialog(this, \学号为\ + txt_sno.getText() + dispose();
new ModifyStudentFrm_info(sno);
public EnterStudentFrm_modify_info() { }
JPanel jp = (JPanel) this.getContentPane(); JPanel jp1 = new JPanel(); JPanel jp2 = new JPanel();
jp1.setLayout(new GridLayout(1, 2, 5, 10)); jp1.add(lb_sno); jp1.add(txt_sno); jp2.add(btn_add);
jp.add(jp1, BorderLayout.NORTH); jp.add(jp2, BorderLayout.SOUTH); btn_add.addActionListener(this); this.setSize(400, 100); this.setVisible(true);
this.setTitle(\请输入学生的学号\);
StudentDao studentDao = new StudentDao(); JButton btn_add = new JButton(\确定\); JLabel lb_sno = new JLabel(\学号\); JTextField txt_sno = new JTextField();
\的记录不存在!\);
Word 资料
}
public static void main(String[] args) { }
new EnterStudentFrm_modify_info();
package project; import javax.swing.*; import java.awt.*; import java.awt.event.*;
public class EnterStudentFrm_modify_score extends JFrame implements ActionListener{
public static void main(String[] args) {
public void actionPerformed(ActionEvent e) { }
if (e.getSource() == btn_add) { }
String sno=txt_sno.getText(); if(studentDao.isExist(sno)){ }
else JOptionPane.showMessageDialog(this, \学号为\ + txt_sno.getText() + dispose();
new ModifyStudentFrm_score(sno);
public EnterStudentFrm_modify_score() { }
JPanel jp = (JPanel) this.getContentPane(); JPanel jp1 = new JPanel(); JPanel jp2 = new JPanel();
jp1.setLayout(new GridLayout(1, 2, 5, 10)); jp1.add(lb_sno); jp1.add(txt_sno); jp2.add(btn_add);
jp.add(jp1, BorderLayout.NORTH); jp.add(jp2, BorderLayout.SOUTH); btn_add.addActionListener(this); this.setSize(400, 100); this.setVisible(true);
this.setTitle(\请输入学生的学号\);
StudentDao studentDao = new StudentDao(); JButton btn_add = new JButton(\确定\); JLabel lb_sno = new JLabel(\学号\); JTextField txt_sno = new JTextField();
\的记录不存在!\);
Word 资料
}
}
new EnterStudentFrm_modify_score();
package project; import javax.swing.*; import java.awt.*; import java.awt.event.*;
public class ModifyStudentFrm_info extends JFrame implements ActionListener{
public ModifyStudentFrm_info(String sno) {
String[] temp =studentDao.queryStudents_info_one(sno); txt_sno.setText(temp[0]); txt_sname.setText(temp[1]); cmb_sex.addItem(\男\); cmb_sex.addItem(\女\);
cmb_sex.setSelectedItem(temp[2]); txt_add.setText(temp[3]); txt_tel.setText(temp[4]);
JPanel jp = (JPanel) this.getContentPane(); JPanel jp1 = new JPanel();
jp1.setLayout(new GridLayout(6, 2, 5, 10)); jp1.add(lb_sno); jp1.add(txt_sno); jp1.add(lb_sname); jp1.add(txt_sname); jp1.add(lb_sex); jp1.add(cmb_sex); jp1.add(lb_add); jp1.add(txt_add); jp1.add(lb_tel); jp1.add(txt_tel);
StudentDao studentDao = new StudentDao(); JButton btn_add = new JButton(\确定\); JButton btn_del = new JButton(\取消\); JLabel lb_sno = new JLabel(\学号\); JLabel lb_sname = new JLabel(\姓名\); JLabel lb_sex = new JLabel(\性别\); JLabel lb_add = new JLabel(\家庭地址\); JLabel lb_tel = new JLabel(\联系\); JTextField txt_sno = new JTextField(); JTextField txt_sname = new JTextField(); JComboBox cmb_sex = new JComboBox(); JTextField txt_add = new JTextField(); JTextField txt_tel = new JTextField();
Word 资料
}
}
jp1.add(btn_add); jp1.add(btn_del);
jp.add(jp1, BorderLayout.NORTH); btn_add.addActionListener(this); btn_del.addActionListener(this); this.setSize(400, 260); this.setVisible(true); this.setTitle(\修改学生信息\);
public void actionPerformed(ActionEvent e) { }
if (e.getSource() == btn_add) { }
if (e.getSource() == btn_del) { }
dispose();
if(studentDao.modifyStudent_info(txt_sno.getText(), txt_sname.getText(), JOptionPane.showMessageDialog(this, \学号为\ + txt_sno.getText() + \的记dispose();
cmb_sex.getSelectedItem().toString(), txt_add.getText(), txt_tel.getText())) 录修改成功!\);
package project; import javax.swing.*; import java.awt.*; import java.awt.event.*;
public class ModifyStudentFrm_score extends JFrame implements ActionListener{
StudentDao studentDao = new StudentDao(); JButton btn_add = new JButton(\确定\); JButton btn_del = new JButton(\取消\); JLabel lb_sno = new JLabel(\学号\); JLabel lb_sname = new JLabel(\姓名\); JLabel lb_math = new JLabel(\高等数学\); JLabel lb_physics = new JLabel(\物理\); JLabel lb_english = new JLabel(\英语\);
JLabel lb_score_tog = new JLabel(\同学互评分\); JLabel lb_score_pol = new JLabel(\品德成绩\); JLabel lb_score_tea = new JLabel(\任课教师评分\); JTextField txt_sno = new JTextField(); JTextField txt_sname = new JTextField(); JTextField txt_math = new JTextField(); JTextField txt_physics = new JTextField(); JTextField txt_english = new JTextField();
Word 资料
JTextField txt_score_tog = new JTextField(); JTextField txt_score_pol = new JTextField(); JTextField txt_score_tea = new JTextField(); public ModifyStudentFrm_score(String sno) { }
public void actionPerformed(ActionEvent e) {
String[] temp =studentDao.queryStudents_score_one(sno); txt_sno.setText(temp[0]); txt_sname.setText(temp[1]); txt_math.setText(temp[2]); txt_physics.setText(temp[3]); txt_english.setText(temp[4]); txt_score_tog.setText(temp[7]); txt_score_pol.setText(temp[8]); txt_score_tea.setText(temp[9]);
JPanel jp = (JPanel) this.getContentPane(); JPanel jp1 = new JPanel();
jp1.setLayout(new GridLayout(9, 2, 5, 10)); jp1.add(lb_sno); jp1.add(txt_sno); jp1.add(lb_sname); jp1.add(txt_sname); jp1.add(lb_math); jp1.add(txt_math); jp1.add(lb_physics); jp1.add(txt_physics); jp1.add(lb_english); jp1.add(txt_english); jp1.add(lb_score_tog); jp1.add(txt_score_tog); jp1.add(lb_score_pol); jp1.add(txt_score_pol); jp1.add(lb_score_tea); jp1.add(txt_score_tea); jp1.add(btn_add); jp1.add(btn_del);
jp.add(jp1, BorderLayout.NORTH); btn_add.addActionListener(this); btn_del.addActionListener(this); this.setSize(400, 380); this.setVisible(true); this.setTitle(\修改学生成绩\);
Word 资料