📄 stuupdate.java~6~
字号:
package java_教务管理系统;
import java.awt.*;
import javax.swing.*;
import java.awt.Rectangle;
import javax.swing.table.DefaultTableModel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.PreparedStatement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Connection;
import javax.swing.table.JTableHeader;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2008</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class stuupdate extends JPanel {
public stuupdate() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(null);
jLabel1.setText("状态:");
jLabel1.setBounds(new Rectangle(315, 384, 36, 15));
jLabel2.setText("学号:");
jLabel2.setBounds(new Rectangle(55, 277, 36, 15));
jLabel3.setText("出生日期:");
jLabel3.setBounds(new Rectangle(315, 305, 60, 15));
cbostubirthdaymonth.setBounds(new Rectangle(465, 302, 58, 23));
jLabel4.setText("月");
jLabel4.setBounds(new Rectangle(533, 305, 12, 15));
jLabel5.setText("毕业学校:");
jLabel5.setBounds(new Rectangle(291, 360, 60, 15));
cbostubirthdaydate.setBounds(new Rectangle(549, 302, 58, 23));
jLabel6.setText("备注:");
jLabel6.setBounds(new Rectangle(54, 412, 36, 15));
txtstuclassno.setBounds(new Rectangle(572, 276, 103, 20));
txtstuno.setBounds(new Rectangle(99, 275, 104, 20));
txtstuname.setBounds(new Rectangle(265, 275, 107, 20));
jLabel7.setText("班级编号:");
jLabel7.setBounds(new Rectangle(507, 278, 60, 15));
txtstuphoto.setBounds(new Rectangle(98, 355, 169, 20));
jLabel8.setText("家庭地址:");
jLabel8.setBounds(new Rectangle(32, 329, 60, 15));
txtstuidcard.setBounds(new Rectangle(99, 303, 192, 20));
tbstu.setBounds(new Rectangle(2, 31, 879, 236));
tbstu.addMouseListener(new stuupdate_tbstu_mouseAdapter(this));
jLabel9.setText("日");
jLabel9.setBounds(new Rectangle(616, 305, 12, 15));
cbostubirthdayyear.setBounds(new Rectangle(380, 302, 58, 23));
jLabel10.setText("年");
jLabel10.setBounds(new Rectangle(444, 305, 12, 15));
jLabel11.setText("姓名:");
jLabel11.setBounds(new Rectangle(224, 278, 36, 15));
txasturemarks.setBounds(new Rectangle(98, 409, 397, 65));
txtstuschool.setBounds(new Rectangle(356, 357, 169, 20));
cbostusex.setBounds(new Rectangle(439, 274, 48, 23));
txtstuaddress.setBounds(new Rectangle(99, 329, 397, 20));
jLabel12.setText("性别:");
jLabel12.setBounds(new Rectangle(395, 278, 36, 15));
jLabel13.setText("身份证号码:");
jLabel13.setBounds(new Rectangle(21, 304, 72, 15));
cbostuappearance.setBounds(new Rectangle(356, 382, 68, 23));
jLabel14.setText("联系电话:");
jLabel14.setBounds(new Rectangle(33, 359, 60, 15));
jLabel15.setText("最高学历:");
jLabel15.setBounds(new Rectangle(33, 383, 60, 15));
cbostubackground.setBounds(new Rectangle(98, 382, 114, 20));
btnstuselect.setBounds(new Rectangle(566, 341, 81, 23));
btnstuselect.setText("查询班级");
btnstuselect.addActionListener(new stuupdate_btnstuselect_actionAdapter(this));
btnstuupdate.setBounds(new Rectangle(582, 384, 81, 23));
btnstuupdate.setText("修改班级");
btnstuupdate.addActionListener(new stuupdate_btnstuupdate_actionAdapter(this));
btnexit.setBounds(new Rectangle(588, 440, 81, 23));
btnexit.setText("退出修改");
jTableHeader1.setBounds(new Rectangle(3, 10, 882, 22));
this.add(jLabel1);
this.add(jLabel2);
this.add(jLabel3);
this.add(cbostubirthdaymonth);
this.add(jLabel4);
this.add(jLabel5);
this.add(cbostubirthdaydate);
this.add(jLabel6);
this.add(txtstuclassno);
this.add(txtstuno);
this.add(txtstuname);
this.add(jLabel7);
this.add(txtstuphoto);
this.add(jLabel8);
this.add(txtstuidcard);
this.add(tbstu);
this.add(jLabel9);
this.add(cbostubirthdayyear);
this.add(jLabel10);
this.add(jLabel11);
this.add(txasturemarks);
this.add(txtstuschool);
this.add(cbostusex);
this.add(txtstuaddress);
this.add(jLabel12);
this.add(jLabel13);
this.add(cbostuappearance);
this.add(jLabel14);
this.add(jLabel15);
this.add(cbostubackground);
this.add(btnstuselect);
this.add(btnstuupdate);
this.add(btnexit);
this.add(jTableHeader1);
}
String stusex[] = {"", "男", "女"};
//出生时间(年)
String stubirthdayyear[] = {"", "1981", "1982", "1983", "1984", "1985",
"1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993"};
//出生时间(月)
String stubirthdaymonth[] = {"", "01", "02", "03", "04", "05", "06", "07",
"08",
"09",
"10", "11", "12"};
//出生时间(日)
String stubirthdaydate[] = {"", "01", "02", "03", "04", "05", "06", "07",
"08",
"09",
"10", "11", "12", "13", "14", "15", "16", "17",
"18", "19", "20", "21", "22", "23", "24", "25",
"26", "27", "28", "29", "30", "31"};
//状态
String stuappearance[] = {"", "在读", "休学", "退学", "转班"};
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JComboBox cbostubirthdaymonth = new JComboBox(stubirthdaymonth);
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JComboBox cbostubirthdaydate = new JComboBox(stubirthdaydate);
JLabel jLabel6 = new JLabel();
JTextField txtstuclassno = new JTextField();
JTextField txtstuno = new JTextField();
JTextField txtstuname = new JTextField();
JLabel jLabel7 = new JLabel();
JTextField txtstuphoto = new JTextField();
JLabel jLabel8 = new JLabel();
JTextField txtstuidcard = new JTextField();
String head[] = {"学号", "姓名", "性别", "班级编号", "身份证", "出生日期", "家庭地址", "联系电话",
"毕业学校", "最高学历", "状态", "备注"};
DefaultTableModel mod = new DefaultTableModel(head, 0);
JTable tbstu = new JTable(mod);
JLabel jLabel9 = new JLabel();
JComboBox cbostubirthdayyear = new JComboBox(stubirthdayyear);
JLabel jLabel10 = new JLabel();
JLabel jLabel11 = new JLabel();
JTextArea txasturemarks = new JTextArea();
JTextField txtstuschool = new JTextField();
JComboBox cbostusex = new JComboBox(stusex);
JTextField txtstuaddress = new JTextField();
JLabel jLabel12 = new JLabel();
JLabel jLabel13 = new JLabel();
JComboBox cbostuappearance = new JComboBox(stuappearance);
JLabel jLabel14 = new JLabel();
JLabel jLabel15 = new JLabel();
String stubackground[] = {"", "初中", "高中", "大专", "本科", "研究生", "博士"};
JComboBox cbostubackground = new JComboBox(stubackground);
JButton btnstuselect = new JButton();
JButton btnstuupdate = new JButton();
JButton btnexit = new JButton();
//状态
String stuappearancename = this.cbostuappearance.getSelectedItem().
toString();
//性别
String stusexname = this.cbostusex.getSelectedItem().toString();
//出生日期
String stubirthdaytime =
this.cbostubirthdayyear.getSelectedItem().toString() + "-" +
this.cbostubirthdaymonth.getSelectedItem().toString() + "-" +
this.cbostubirthdaydate.getSelectedItem().toString() + " ";
JTableHeader jTableHeader1 = tbstu.getTableHeader();
public void btnstuselect_actionPerformed(ActionEvent e) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -