按关键词阅读: 学籍 学生 源代码 java 系统 管理
public mainframe()JLabel label=new JLabel(new ImageIcon( 图片 44.jpg);
label.s 。
12、etSize(400,400);
pan.add(label);
pan.setLayout(null);
pan.setSize(400,400);
this.setTitle( 学籍管理系统 );
this.setSize(400,400);
this.setLayout(null);
label1.setBounds(100,25,49,20);
textField1.setBounds(155,24,120,20);
label2.setBounds(100,62,49,20);
password.setBounds(155,61,120,20);
button1.setBounds(15 。
13、0,200,101,22);
radioButton1.setBounds(105,120,80,20);
radioButton2.setBounds(180,120,60,20);
radioButton3.setBounds(240,120,60,20);
button1.addActionListener(this);
buttonGroup.add(radioButton1);
buttonGroup.add(radioButton2);
buttonGroup.add(radioButton3);
this.add(radioButton1);
this.add(radioButton2 。
14、);
this.add(radioButton3);
this.add(label1);
this.add(label2);
this.add(textField1);
this.add(password);
this.add(button1);
this.add(pan);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
public static void main(String args)new mainframe();
public void actionPerformed(Action 。
15、Event e)if(radioButton1.isSelected()/ if(textField1.getText().equals(syc) password.getText().equals(123)interfac b=new interfac();
this.dispose();
/JOptionPane.showMessageDialog(null, 登陆成功 );
else if(.equals(textField1.getText() .equals(password.getText() )JOptionPane.showMessageDialog(null, 用户名或密码不能为 。
16、管理员&|else用户名或密码输入JOptionPane.showMessageDialog(null, 有误);
学生if(radioButton2.isSelected()/ tryClass.forName(sun.jdbc.odbc.JdbcOdbcDriver);
catch (ClassNotFoundException ce)JOptionPane.showMessageDialog(s,ce.getMessage();
tryConnection conDriverManager.getConnection(jdbc:odbc:stu,sa,);
Statement stmt = c 。
17、on.createStatement();
ResultSet rs = stmt.executeQuery(select * from password where 户 名 = +textField1.getText()+ and 密 码 +password.getText()+);
if(textField1.getText().equals()|password.getText().equals() 用户名或密码您的输入有误 );
JOptionPane.showMessageDialog(this,不可为空! );
else if(rs.next() new interfac();
elseJO 。
18、ptionPane.showMessageDialog(this,/stmt.close();
catch (SQLException se) JOptionPane.showMessageDialog(s,se.getMessage();
/interface.javaimport java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class interfac extends JFrame implements ActionListener菜单条菜单项添加信息 );
/ 菜单子项 修改信息 );
信息查询 );
删除信息 );
。
19、static JMenuBar jMenuBar = new JMenuBar();
/ static JMenu jMenuFile = new JMenu(文件 );
/static JMenu jMenuExit = new JMenu(退出 );
请选择操作项 );
学籍管理系统 );
添加信息 );
修改信息 );
信息查询 );
删除信息 );
static JMenuItem jMenuItem1 = new JMenuItem( static JMenuItem jMenuItem2 = new JMenuItem( static JMenuItem jMenuItem3 = new。
20、JMenuItem( static JMenuItem jMenuItem4 = new JMenuItem(staticstaticstaticstaticstaticstaticJLabel label3 = new JLabel( JLabel label4 = new JLabel( JButton button2 = new JButton(JButton button3 = new JButton( JButton button4 = new JButton(JButton button5 = new JButton(public interfac()this.setTitle(。
21、学籍管理系统 );
this.setLayout(null);
this.setSize(400,400);
label3.setBounds(158,92,98,33);
label3.setFont(new Font(Dialog,Font.PLAIN,15);
label4.setFont(new Font(Dialog,Font.BOLD,20);
label4.setBounds(157,37,280,40);
button2.setBounds(74,136,97,33);
button3.setBounds(226,136,97,33);
button4.setBounds(74,18 。
22、5,97,33);
button5.setBounds(226,185,97,33);
this.add(button2);
this.add(button3);
this.add(button4);
this.add(button5);
this.add(label3);
this.add(label4);
setJMenuBar(jMenuBar);
jMenuFile.add(jMenuItem1);
/ ”文件“菜单项中加入子菜单 jMenuFile.add(jMenuItem2);
jMenuFile.add(jMenuItem3);
jMenuFile.add(jMenuItem4);
jMen 。
23、uBar.add(jMenuFile);
/ 将菜单项加入菜单条 jMenuBar.add(jMenuExit);
本窗口向按钮事件源注册本窗口菜单子项注册button2.addActionListener(this);
/ button3.addActionListener(this);
button4.addActionListener(this);
button5.addActionListener(this);
jMenuItem1.addActionListener(this);
/ jMenuItem2.addActionListener(this);
jMenuItem3.addActi 。
24、onListener(this);
jMenuItem4.addActionListener(this);
jMenuExit.addActionListener(this);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
public static void main(String args) interfac a=new interfac();
按钮事件的处理public void actionPerformed(ActionEvent e) / if(e.getSource()=jMe 。
来源:(未知)
【学习资料】网址:/a/2021/0322/0021748076.html
标题:学生|学生学籍管理系统有java源代码( 二 )