NetBeans实现学生信息管理系统源码Word格式.docx
- 文档编号:20709890
- 上传时间:2023-01-25
- 格式:DOCX
- 页数:52
- 大小:106.99KB
NetBeans实现学生信息管理系统源码Word格式.docx
《NetBeans实现学生信息管理系统源码Word格式.docx》由会员分享,可在线阅读,更多相关《NetBeans实现学生信息管理系统源码Word格式.docx(52页珍藏版)》请在冰豆网上搜索。
AssociateCoordinator:
Acknowledgement
IwouldliketothankourFacultyMr.ShahnawazandChineseassociateFacultyMs.LiFanfanforalltheirguidanceandsupportduringtheentirephaseofthisprojectdevelopmentwithoutwhichtheprojectwouldnothavebeencompleted.
SystemAnalysis
SystemSummary:
Itisconvenientfortheuserstomanagestudentinformation.forexample:
add,delete,updateandoverviewstudentinformation.
BusinessRules:
1,createdatabase,tablesandconstraints.
2,interfacedesign
3,implementthesourcecode
4,debugandtest
DataQuery:
createdatabaseSIMS
useSIMS
createtableuseinfo
(uidintprimarykeyidentity(101,1),
unamenchar(20)notnull,
upasswordnchar(10)default'
00000'
urealnamenchar(20),
umobilnchar(15)
)
createtablestudentinfor
(sidintprimarykeyidentity(10001,1),
snamenchar(20)notnull,
sgenderchar(4),
sbirthdaynchar(15),
smobilnchar(15),
semilnchar(20),
sacademynchar(20),
smajornchar(20),
altertableuseinfo
addconstraintuniqunique(uname)
altertablestudentinfor
addconstraintununique(sname)
altercolumnsmobilchar(11)
dropconstraintDF__useinfo__upasswo__108B795B
//HowtoUseUpdate、Insert、Select、deleteinCode
1)stat=con.prepareStatement("
updatestudentinforsetsgender=?
sbirthday=?
smobil=?
semil=?
sacademy=?
smajor=?
wheresid=?
"
);
2)stat=con.prepareStatement("
insertintouseinfovalues(?
?
)"
3)ResultSetrs=stmt.executeQuery("
SELECT*FROMuseinfo"
4)stat=con.prepareStatement("
deletefromstudentinforwheresid=?
Configuration
Hardware:
Intel(R)Pentium(R)DualE21802.1GHz
1.20GHz3.00GBRAM
250GB7200RPMHardDisk
10/100NIC
OpticalMouse
Keyboard
17"
ColorMonitor
OperatingSystem:
MicrosoftWindows07
Software:
NetbeansIDE7.2.1、MicrosoftSQLServer2008
IndividualProjectSchedule
SrNo
ActivityDescription
Planneddateof
Completion
ActualDate
Remarks
1
CreateDatabase
09/03/2013
NoProblem
2
InterfaceDesign
3
InterfaceImplementation
11/03/2013
Noproblem
4
FunctionImplementation
13/03/2013
5
Debugging
ManyProblemshadbeensolved
6
7
8
9
10
11
SourceCode
//loginGUIandthemainfunction
//StudentMain.java
packagestudentinformationmanagementsystem;
importjava.awt.*;
importjavax.swing.*;
importjava.awt.event.*;
importjava.sql.*;
importjavax.swing.UIManager;
publicclassStudentMainextendsJFrameimplementsActionListener
{
JLabelLtitle,Lname,Lpassword;
JButtonBlogin,Bexit,Lregister;
JTextFieldTFname;
JPasswordFieldTFpassword;
GridBagLayoutgbl;
GridBagConstraintsgbc;
GridLayoutgl;
Fontf1,f2,f3;
JPanelp1,p2;
Connectioncon;
PreparedStatementstat;
Statementstmt;
ResultSetrs;
publicStringname;
publicStudentMain(booleanflag)
{
//booleanf=f
super("
StudentInformationManagementSystem"
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f1=newFont("
宋体"
1,25);
f2=newFont("
1,20);
f3=newFont("
1,18);
Ltitle=newJLabel("
StudentInformationManagementSystem"
JLabel.CENTER);
gl=newGridLayout(3,1);
p1.setLayout(gbl);
gbc.fill=GridBagConstraints.NONE;
gbc.insets=newInsets(0,0,11,10);
gbc.anchor=GridBagConstraints.CENTER;
gbc.gridwidth=1;
gbl.setConstraints(Lname,gbc);
p1.add(Lname);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gbc.anchor=GridBagConstraints.LINE_START;
gbl.setConstraints(TFname,gbc);
p1.add(TFname);
gbl.setConstraints(Lpassword,gbc);
p1.add(Lpassword);
gbl.setConstraints(TFpassword,gbc);
p1.add(TFpassword);
p2.setLayout(newFlowLayout(FlowLayout.CENTER,20,0));
p2.add(Blogin);
p2.add(Bexit);
p2.add(Lregister);
this.setLayout(gl);
this.add(Ltitle);
this.add(p1);
this.add(p2);
Blogin.addActionListener(this);
Bexit.addActionListener(this);
Lregister.addActionListener(this);
DimensionscreenSize=Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-365)/2,(screenSize.height-449)/2,550,350);
this.setVisible(flag);
}
publicvoidactionPerformed(ActionEventae)
if(ae.getActionCommand()=="
Exit"
System.exit(0);
Login"
name=TFname.getText();
Stringpassword=TFpassword.getText();
if(name.equals("
)||password.equals("
))
JOptionPane.showMessageDialog(null,"
UserName,UserPasswordisnotnull"
else{
try
Class.forName("
sun.jdbc.odbc.JdbcOdbcDriver"
con=DriverManager.getConnection("
jdbc:
odbc:
DataSource"
"
Statementstmt=con.createStatement();
ResultSetrs=stmt.executeQuery("
booleanisfind=false;
while(rs.next())
if(name.equals(rs.getString
(2)))
isfind=true;
if(password.equals(rs.getString(3)))
this.dispose();
newFunction(name);
TFname.setText("
TFpassword.setText("
else
Passwordisworng!
break;
if(isfind==false)
NotExsittheUser,PleaseRegister!
con.close();
}catch(Exceptione)
System.out.println("
Error"
+e.getMessage());
Register"
newAddUser();
}
publicstaticvoidmain(String[]args){
//TODOcodeapplicationlogichere
UIManager.setLookAndFeel(newcom.sun.java.swing.plaf.windows.WindowsLookAndFeel());
catch(Exceptione)
{
newStudentMain(true);
}
//FunctionGUI
//Function.java
packagestudentinformationmanagementsystem;
importjavax.swing.table.*;
importjava.util.*;
publicclassFunctionextendsJFrameimplementsActionListener
JMenufunmenu1,funmenu2,funmenu3;
JMenuItemmenuitempwd,menulogout,menuexit,menuoverview;
JPanelfunpl1,funpl2,funpl3,funpl4,funpl5,funpl6;
JLabelfunlb1,funlb2;
JButtonfunjbadd,funjbdelete,funjbupdate,funjboverview,funjbok,funjbcancel;
JMenuBarfunmenubar;
JComboBoxfunjcb1;
JTextFieldfunjtf1,funjtf2;
Fontfunf1;
JScrollPanejsp;
JTablefunjtb;
JScrollPanefunjsp;
ResultSetMetaDatarsmd;
publicStringss;
Function(Stringstr)
StudentManagementSystem"
ss=str;
setLayout(null);
funjsp=newJScrollPane();
funf1=newFont("
Arial"
Font.BOLD|Font.ITALIC,20);
funjcb1=newJComboBox();
funjcb1.addItem("
selectbyID"
selectbyname"
funjcb1.addActionListener(this);
funpl2=newJPanel();
funpl2.setLayout(newFlowLayout(FlowLayout.CENTER,0,3));
funpl3=newJPanel();
funpl3.setLayout(newFlowLayout(FlowLayout.LEFT,20,3));
funpl4=newJPanel();
funpl4.setLayout(newFlowLayout(FlowLayout.CENTER,20,3));
funpl5=newJPanel();
funpl5.setLayout(newGridLayout(4,1));
funpl6=newJPanel();
funpl6.setLayout(newFlowLayout());
funmenubar=newJMenuBar();
funmenubar.setBounds(0,0,490,30);
funlb1=newJLabel("
WelcomeToTheSystem!
"
funlb1.setFont(funf1);
Objecttablesize[][]=newObject[20][8];
for(inti=0;
i<
20;
i++)
for(intj=0;
j<
8;
j++)
tablesize[i][j]=null;
Stringcolumn[]={"
sid"
sname"
sgender"
sbirth"
smobil"
semil"
sacademy"
smajor"
};
funjtb=newJTable(tablesize,column);
funjtb.setShowGrid(true);
funjtf1=newJTextField(25);
funjtf1.addActionListener(this);
funjbadd=newJButton("
Add"
funjbadd.addActionListener(this);
funjbdelete=newJButton("
Delete"
funjbdelete.addActionListener(this);
funjboverview=newJButton("
Overview"
funjboverview.addActionListener(this);
funjbupdate=newJButton("
Update"
funjbupdate.addActionListener(this);
funjbok=newJButton("
OK"
funjbok.addActionListener(this);
funjbcancel=newJButton("
Cancel"
funjbcancel.addActionListener(this);
funmenu1=newJMenu("
usermanagement"
funmenu2=newJMenu("
overview"
funmenu3=newJMenu("
help"
menuoverview=newJMenuItem("
checkmyinfomation"
JMenuItem.CENTER);
menuoverview.addActionListener(this);
menuitempwd=newJMenuItem("
passwordmanagement"
menuitempwd.addActionListener(this);
funmenu1.add(menuoverview);
funmenu1.add(menuitempwd);
menulogout=newJMenuItem("
LogOut"
menulogout.addActionListener(this);
funmenu1.add(menulogout);
menuexit=newJMenuItem("
menuexit.addActionListener(this);
funmenu1.add(menuexit);
funmenubar.add(funmenu1);
funmenubar.add(funmenu2);
funmenubar.add(funmenu3);
funpl2.add(funlb1);
funpl3.add(funjcb1);
funpl3.add(funjtf1);
funpl3.add(funjbok);
funpl3.add(funjbcancel);
funpl4.add(funjboverview);
funpl4.add(funjbadd);
funpl4.add(funjbdelete);
funpl
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- NetBeans 实现 学生 信息管理 系统 源码
![提示](https://static.bdocx.com/images/bang_tan.gif)