基于Java和Oracle的学生信息管理系统 联系客服

发布时间 : 星期六 文章基于Java和Oracle的学生信息管理系统更新完毕开始阅读

jmb.add(logpassword); jpl.setBackground(Color.white); Message.add(Item1); Message.add(Item2); logpassword.add(Item3); Score.add(Item4);

Item1.addActionListener(this); Item2.addActionListener(this); Item3.addActionListener(this); Item4.addActionListener(this);

}

@SuppressWarnings(\

public void actionPerformed(ActionEvent e) { }

public static void main(String[] args) {

if(e.getSource()==Item1) { }

else if(e.getSource()==Item2) { }

else if(e.getSource()==Item3) { } else { }

Score sc = new Score();

stulogpassword change = new stulogpassword(); Search ser = new Search();

AddMessage ad = new AddMessage();

@SuppressWarnings(\

9

} }

Students stu = new Students();

2.2.学生添加个人信息模块 //函数库

import javax.swing.*; import java.awt.event.*; import java.sql.*;

public class AddMessage extends JFrame implements ActionListener {

private static final long serialVersionUID = 1L; static AddMessage s; /*添加学生信息控件*/ JPanel jpl = new JPanel();

JLabel label1 = new JLabel(\密 码\,JLabel.CENTER); JLabel label2 = new JLabel(\学 号\,JLabel.CENTER); JLabel label3 = new JLabel(\姓 名\,JLabel.CENTER); JLabel label4 = new JLabel(\性 别\,JLabel.CENTER); JLabel label6 = new JLabel(\班 级\,JLabel.CENTER); JLabel label7 = new JLabel(\学 院\,JLabel.CENTER); JTextField oldpassword = new JTextField(8); JTextField num = new JTextField(2); JTextField nam = new JTextField(4); ButtonGroup bgp = new ButtonGroup(); JRadioButton man = new JRadioButton(\男\); JRadioButton women = new JRadioButton(\女\); JTextField clas = new JTextField(); JTextField scl = new JTextField(); JButton reset = new JButton(\清 空\); JButton addmsg = new JButton(\添 加\); public AddMessage() {

10

super(\添加基本信息\); this.setSize(500,400); this.setVisible(true); //将当前窗口防止在屏幕中央 this.setResizable(false);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.add(jpl); jpl.setLayout(null);

addmsg.addActionListener(this); reset.addActionListener(this); /*插入面板*/

label1.setBounds(130,60,80,20); jpl.add(label1);

oldpassword.setBounds(190,60,140,20); jpl.add(oldpassword);

label2.setBounds(135,20,70,20); jpl.add(label2);

num.setBounds(190,20,140,20); jpl.add(num);

label3.setBounds(135,100,70,20); jpl.add(label3);

nam.setBounds(190,100,140,20); jpl.add(nam);

label4.setBounds(135,140,70,20); jpl.add(label4);

man.setBounds(210,140,60,20); women.setBounds(280,140,60,20); jpl.add(man); jpl.add(women); bgp.add(man); bgp.add(women);

11

setLocationRelativeTo(null);

}

label6.setBounds(135,180,70,20); jpl.add(label6);

clas.setBounds(190,180,140,20); jpl.add(clas);

label7.setBounds(135,220,70,20); jpl.add(label7);

scl.setBounds(190,220,140,20); jpl.add(scl);

reset.setBounds(190,260,65,20); addmsg.setBounds(265,260,65,20); jpl.add(reset); jpl.add(addmsg);

@SuppressWarnings(\)

public void actionPerformed(ActionEvent e) {

if(e.getSource()==addmsg) {

String sex=null; String id,b,c,d, f; id= num.getText(); b= nam.getText(); c= oldpassword.getText(); d= clas.getText(); f= scl.getText();

if(id.equals(\)||b.equals(\)||c.equals(\)||d.equals(\)) { }

else if((!man.isSelected())&&(!women.isSelected())) {

12

JOptionPane.showMessageDialog(this,\你输入的信息不全,无

法完成添加!\);