傻大方


首页 > 知识库 > >

学生|学生学籍管理系统有java源代码( 三 )


按关键词阅读: 学籍 学生 源代码 java 系统 管理



25、nuExit) System.exit(0);
else if(e.getSource()=jMenuItem1|e.getSource()=button2) try tj a=new tj();
catch(Exception ee) else if(e.getSource()=jMenuItem2|e.getSource()=button3) try xg a=new xg();
catch(Exception ed) else if(e.getSource()=jMenuItem3|e.getSource()=button4) trycx a=new cx();
catch(Excepti 。

26、on ec) else if(e.getSource()=jMenuItem4|e.getSource()=button5)/tj.javatrysc a=new sc();
catch(Exception es)添加界面 import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class tj extends JFrame implements ActionListener static tj s;
static JLabel label1 = new JLabel(学号 。

27、 :);
static JTextField textField1 = new JTextField();
static JLabel label2 = new JLabel(姓名 :);
static JTextField textField2 = new JTextField();
static JLabel label3 = new JLabel(性别 :);
static JTextField textField7=new JTextField();
static JLabel label4 = new JLabel( 出生日期 :);
static JTextField textField 。

28、3 = new JTextField();
static JLabel label5 = new JLabel( 政治面貌 :);
static JTextField textField8=new JTextField();
static JLabel label6 = new JLabel(籍贯 );
static JTextField textField4 = new JTextField();
static JLabel label7 = new JLabel(系别 :);
static JTextField textField9 = new JTextField();
static JLabe 。

29、l label8 = new JLabel(专业 :);
static JTextField textField5 = new JTextField();
static JButton button1 = new JButton( 增加 );
public tj() this.setTitle( 增加学生信息 );
this.setLayout(null);
this.setSize(400,400);
label1.setBounds(30, 11, 51, 33);
textField1.setBounds(86, 16, 74, 22);
label2.setBounds(162, 11,。

30、51, 33);
textField2.setBounds(192, 16, 44, 22);
label3.setBounds(241, 11, 70, 33);
textField7.setBounds(275, 15, 50, 25);
label4.setBounds(31, 53, 55, 33);
textField3.setBounds(86, 58, 74, 22);
label5.setBounds(241, 53, 70, 33);
textField8.setBounds(296, 57, 72, 25);
label6.setBounds(163, 53, 26, 33 。

31、);
textField4.setBounds(191, 58, 44, 22);
label7.setBounds(30, 94, 50, 33);
textField9.setBounds(86,94,74,22);
label8.setBounds(163, 94, 51, 33);
textField5.setBounds(190, 99, 178, 22);
button1.setBounds(25,241,80,33);
button1.addActionListener(this);
this.add(label1);
this.add(label2);
this.add(lab 。

32、el3);
this.add(label4);
this.add(label5);
this.add(label6);
this.add(label7);
this.add(label8);
this.add(textField1);
this.add(textField2);
this.add(textField3);
this.add(textField4);
this.add(textField5);
this.add(textField7);
this.add(textField8);
this.add(textField9);
this.add(button1);
this.setDe 。

33、faultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setVisible(true);
public static void main(String args) throws Exceptionnew tj();
tj a=事件处理程序a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void actionPerformed(ActionEvent e)/ if (e.getSource() = button1) tryClass.forName(sun.jdbc.odbc.Jdb 。

34、cOdbcDriver);
catch (ClassNotFoundException ce) JOptionPane.showMessageDialog(s,ce.getMessage();
tryConnection con DriverManager.getConnection(jdbc:odbc:stu,sa, );
Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery(select * from xinxi where 学 号 =+textField1.getText()+);
if(rs.next()。

35、JOptionPane.showMessageDialog(null, 此学号已经被注册 );
else stmt.execute(insert into xinxi (学号,姓名, 性别, 出生日期 , 政治面貌 ,籍贯, 系别, 专业) values (+ textField1.getText()+,+textField2.getText()+,+textField7.getText()+,+ textField3.getText()+,+textField8.getText()+,+textField4.getText()+,+ textField9.getText()+,+textFie 。

36、ld5.getText()+);
JOptionPane.showMessageDialog(null, 添加信息成功 );
catch (SQLException se) JOptionPane.showMessageDialog(s,se.getMessage();
/xg.java 修改界面 import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class xg extends JFrame implements ActionListener static xg s;
st 。

37、atic JLabel label1 = new JLabel(学号 :);
static JTextField textField1 = new JTextField();
static JLabel label2 = new JLabel(姓名 :);
static JTextField textField2 = new JTextField();
static JLabel label3 = new JLabel(性别 :);
static JTextField textField7=new JTextField();
static JLabel label4 = new JLabel(出生日期 。

38、 :);
static JTextField textField3 = new JTextField();
static JLabel label5 = new JLabel(政治面貌 :);
static JTextField textField8=new JTextField();
static JLabel label6 = new JLabel( 籍贯 );
static JTextField textField4 = new JTextField();


来源:(未知)

【学习资料】网址:/a/2021/0322/0021748076.html

标题:学生|学生学籍管理系统有java源代码( 三 )


上一篇:婚礼|婚礼上的对联

下一篇:姜丝|姜丝洋葱拌皮蛋