2022年JAVA学生管理源代码.docx
《2022年JAVA学生管理源代码.docx》由会员分享,可在线阅读,更多相关《2022年JAVA学生管理源代码.docx(65页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品学习资源/Student_Management_System.java/JHelpTextPanel.java import java.awt.*;import java.awt.event.*;import javax.swing.*; import javax.swing.event.*;import java.io.*;/ 定义帮忙文档类class JHelpTextPanel extends JPanelFont newSmallTitleFont=new Font JTextArea HelpText=new JTextArea楷体,Font.BOLD,12;JHelpTextP
2、anelsetLayoutnull;setBackgroundColor.orange;HelpText.setBackgroundColor.orange;HelpText.setForegroundColor.red;HelpText.setFontnewSmallTitleFont;HelpText.setBounds0,0,600,600;addHelpText;/Student_InforPanel .javaimport java.awt.*; import java.awt.event.*;import javax.swing.*;import javax.swing.event
3、.*;import java.io.*;class Student_InforPanel extends JPanel implements ActionListener/ 四种常用字体的定义Font newTitleFont=new Font楷体,Font.BOLD,40; Font newSmallTitleFont=new Font楷体,Font.BOLD,25 ;Font newCommonFont=new Font宋体,Font.BOLD,20;欢迎下载精品学习资源Font newSubMenuFont=new Font 宋体,Font.BOLD,15 ;Font NewSubMen
4、uFont=new Font 宋体,Font.BOLD,10 ;/ 性别数组定义String os=男 ,女 ;/定义确认对话框图标ImageIcon thinker=new ImageIconICON/thinker.gif;/定义同学信息治理系统面板菜单控件JLabel StudentSno_Clue=new JLabel学号: ;JLabel StudentName_Clue=new JLabel姓名: ;JLabel StudentSex_Clue=new JLabel性别: ;JLabel StudentAge_Clue=new JLabel年龄: ;JLabel StudentCl
5、ass_Clue=new JLabel班级: ;JLabel StudentDept_Clue=new JLabel系别: ;JTextField StudentSno_Input=new JTextField;JTextField StudentName_Input=new JTextField;ComboBoxModel Othermode=new OtherAModel;JComboBox StudentSex_Input=new JComboBoxOthermode;JTextField StudentAge_Input=new JTextField;JTextField Studen
6、tClass_Input=new JTextField;JTextField StudentDept_Input=new JTextField;JTextArea QueryInforShow=new JTextArea;JLabel QueryClue=new JLabel以下是你要查询的同学信息 : ;JButton Add_StudentInformation=new JButton增加同学信息 ;JButton Del_StudentInformation=new JButton删除同学信息 ;JButton Query_StudentInformation=new JButton查询
7、同学信息 ;JButton Modify_StudentInformation=new JButton修改同学信息 ;/定义变量int ValidAge;String SnoOrigin;Student_InforPanelsetBackgroundColor.orange;QueryInforShow.setBackgroundColor.orange;setLayoutnull;StudentSno_Clue.setBounds270,120,80,30;StudentSno_Clue.setFontnewCommonFont ;StudentSno_Input.setBounds350,
8、120,120,30;StudentName_Clue.setBounds270,170,80,30;StudentName_Clue.setFontnewCommonFont;欢迎下载精品学习资源StudentName_Input.setBounds350,170,120,30;StudentSex_Clue.setBounds270,220,80,30;StudentSex_Clue.setFontnewCommonFont ;StudentSex_Input.setBounds350,220,120,30;StudentAge_Clue.setBounds270,270,80,30;St
9、udentAge_Clue.setFontnewCommonFont ;StudentAge_Input.setBounds350,270,120,30;StudentClass_Clue.setBounds270,320,80,30;StudentClass_Clue.setFontnewCommonFont;StudentClass_Input.setBounds350,320,120,30;StudentDept_Clue.setBounds270,370,80,30;StudentDept_Clue.setFontnewCommonFont ;StudentDept_Input.set
10、Bounds350,370,120,30;Query_StudentInformation.setBounds80,120,130,30;Query_StudentInformation.setFontnewSubMenuFont;Query_StudentInformation.addActionListenerthis;QueryClue.setBounds80,180,300,50;QueryClue.setFontnewSubMenuFont ;QueryInforShow.setBounds80,220,530,100;QueryInforShow.setFontnewSubMenu
11、Font;Del_StudentInformation.setBounds80,120,130,30;Del_StudentInformation.setFontnewSubMenuFont;Del_StudentInformation.addActionListenerthis;Add_StudentInformation.setBounds80,170,130,30;Add_StudentInformation.setFontnewSubMenuFont;Add_StudentInformation.addActionListenerthis;Modify_StudentInformati
12、on.setBounds80,220,130,30;Modify_StudentInformation.setBounds80,220,130,30;Modify_StudentInformation.setFontnewSubMenuFont;Modify_StudentInformation.addActionListenerthis;addStudentSno_Clue ;addStudentSno_Input;addStudentName_Clue ;addStudentName_Input ;addStudentSex_Clue ;addStudentSex_Input;addStu
13、dentAge_Clue ;addStudentAge_Input;addStudentClass_Clue;addStudentClass_Input;addStudentDept_Clue;addStudentDept_Input;欢迎下载精品学习资源addQueryClue ;addQueryInforShow ;addAdd_StudentInformation;addDel_StudentInformation;addQuery_StudentInformation;addModify_StudentInformation;public void actionPerformedAct
14、ionEvent eife.getSource=Add_StudentInformationifIsValidAgeStudentAge_Input.getTextString *=StringStudentSex_Input.getSelectedItem;MainMenu.myDatabase.Add_Database_InformationStudentSno_Input.ge tText,StudentName_Input.getText,*,ValidAge,StudentClass_Input.getT ext,StudentDept_Input.getText;emptyInpu
15、t;ife.getSource=Del_StudentInformationQueryInforShow.setText;ifMainMenu.myDatabase.Query_Database_InformationStuden tSno_Input.getTextQueryInforShow.setTextDataBaseControl.temptInformation;int result=JOptionPane.showConfirmDialognull,你确定要删除该生信息吗? ,ConfirmMessage,JOptionPane.YES_NO_OPTION,JOptionPane
16、.QUESTION_MESSAGE,think er ;ifresult=JOptionPane.YES_OPTIONifMainMenu.myDatabase.Del_Database_InformationSt udentSno_Input.getTextJOptionPane.showMessageDialognull,删除操作成功!,Happy Message,JOptionPane.PLAIN_MESSAGE;elseJOptionPane.showMessageDialognull,数据库操作显现反常,删除操作失败! ,Error Message,JOptionPane.ERROR
17、_MESSAGE;else欢迎下载精品学习资源息. ;QueryInforShow.setText对不起,没有找到你要删除的同学信欢迎下载精品学习资源ife.getSource=Query_StudentInformationQueryInforShow.setText;ifMainMenu.myDatabase.Query_Database_InformationStud entSno_Input.getTextQueryInforShow.setTextDataBaseControl.temptInformatio欢迎下载精品学习资源n ;信息 ;elseQueryInforShow.se
18、tText对不起,没有你想要查询的同学欢迎下载精品学习资源ife.getSource=Modify_StudentInformationifIsValidAgeStudentAge_Input.getTextMainMenu.myDatabase.Modify_Database_InformationSnoOri gin,StudentSno_Input.getText,StudentName_Input.getText,ValidAge,StudentClass_Inpu t.getText,StudentDept_Input.getText;欢迎下载精品学习资源trypublic bool
19、ean IsValidAgeString StringAgeValidAge=Integer.parseIntStringAge;欢迎下载精品学习资源catchNumberFormatException ee.printStackTrace;return false;ifValidAge0 return true;elseJOptionPane.showMessageDialognull,你输入的年龄不合实际情形 n请重新输入 .,WARNING MESSAGE,JOptionPane.WARNING_MESSAG;E return false;欢迎下载精品学习资源class OtherAMo
20、del extends DefaultComboBoxModelOtherAModelforint i=0;ios.length;i+ addElementosi;public void emptyInputStudentSno_Input.setText;StudentAge_Input.setText;StudentName_Input.setText;StudentClass_Input.setText;StudentDept_Input.setText;public void OnlyShowSnoStudentSno_Clue.setVisibletrue;StudentSno_In
21、put.setVisibletrue;StudentSno_Input.setText;QueryClue.setVisibletrue;QueryInforShow.setVisibletrue;StudentName_Clue.setVisiblefalse;StudentName_Input.setVisiblefalse;StudentSex_Clue.setVisiblefalse;StudentSex_Input.setVisiblefalse;StudentAge_Clue.setVisiblefalse;StudentAge_Input.setVisiblefalse;Stud
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 JAVA 学生 管理 源代码
限制150内