资源简介

软件工程课程设计报告--java学生管理系统,其中包括完整的源代码,是一个很好的课程设计报告,大家可以下载下来参考学习,是学习Swing的一个相当好的例子。

资源截图

代码片段和文件信息

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
public class AddAdminframe extends Jframe{
private JTextField tfUserpassword;
    private String tfUser1password1;    
static final String JDBC_DRIVER=“sun.jdbc.odbc.JdbcOdbcDriver“;
static final String DATAbase_URL=“jdbc:odbc:studyDSN“;
private Connection connection;
private Statement statement;
String sqlInsert;
public AddAdminframe(){
super(“新帐户添加“);
//       Jframe frame = new Jframe(“新帐户添加“);
try
{
Class.forName(JDBC_DRIVER);
connection = DriverManager.getConnection(DATAbase_URL“sa““8882551“);
statement = connection.createStatement();
}
catch(SQLException sqlException)
{
JOptionPane.showMessageDialog(nullsqlException.getMessage()“Database Error“JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
catch(ClassNotFoundException classNotFound)
{
JOptionPane.showMessageDialog(nullclassNotFound.getMessage()“Driver Not Found“JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
Box horizontal1=Box.createHorizontalBox();
Box horizontal2=Box.createHorizontalBox();
Box horizontal3=Box.createHorizontalBox();
Box horizontal4=Box.createHorizontalBox();
Box horizontal5=Box.createHorizontalBox();
Box horizontal6=Box.createHorizontalBox();
Box horizontal7=Box.createHorizontalBox();
Box vertical1=Box.createVerticalBox();
Box vertical2=Box.createVerticalBox();
Container container=getContentPane();
container.setLayout(new FlowLayout());
JLabel lbtitle=new JLabel(“新帐户添加“);
lbtitle.setFont(new Font(““Font.BOLD18));
horizontal1.add(lbtitle);
JLabel lbUser3=new JLabel(“    “);
horizontal7.add(lbUser3);
horizontal7.setSize(30015);
//container.add(lbtitle);
JLabel lbUser=new JLabel(“用户名:“);
horizontal2.add(lbUser);
//container.add(lbUser);
final JTextField tfUser=new JTextField(10);
horizontal2.add(tfUser);
//container.add(tfUser);
JLabel lbUser2=new JLabel(“    “);
horizontal6.add(lbUser2);
horizontal6.setSize(30015);
JLabel lbpassword=new JLabel(“密码:“);
horizontal3.add(lbpassword);
//container.add(lbpassword);
final JPasswordField password=new JPasswordField(10);
horizontal3.add(password);
vertical1.add(horizontal7);
vertical1.add(horizontal2);
vertical1.add(horizontal6);
vertical1.add(horizontal3);
JLabel lbUser1=new JLabel(“    “);
horizontal5.add(lbUser1);
horizontal5.setSize(30015);
//container.add(password);
/*添加按钮监听*/
JButton InButton=new JButton(“添加“);
horizontal4.add(InButton);
InButton.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
          
           tfUser1=tfUser.getText();
           password1=password.getText();            
           addAdmin(tfUser1password1);                          
}
}
);
JLabel lbUser5=new JLabel(“    “

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1086  2007-07-19 19:32  SIMS源代码\AddAdminframe$1.class

     文件        804  2007-07-19 19:32  SIMS源代码\AddAdminframe$2.class

     文件       4373  2007-07-19 19:32  SIMS源代码\AddAdminframe.class

     文件       4667  2007-07-19 19:32  SIMS源代码\AddAdminframe.java

     文件        525  2007-07-19 19:34  SIMS源代码\AddStudentframe$1.class

     文件        601  2007-07-19 19:34  SIMS源代码\AddStudentframe$2.class

     文件        498  2007-07-19 19:34  SIMS源代码\AddStudentframe$3.class

     文件       3920  2007-07-19 19:34  SIMS源代码\AddStudentframe.class

     文件       3434  2007-07-19 19:34  SIMS源代码\AddStudentframe.java

     文件       1054  2007-07-19 16:41  SIMS源代码\AdminStudentframe$1.class

     文件        538  2007-07-19 16:41  SIMS源代码\AdminStudentframe$2.class

     文件        541  2007-07-19 16:41  SIMS源代码\AdminStudentframe$3.class

     文件        541  2007-07-19 16:41  SIMS源代码\AdminStudentframe$4.class

     文件       1971  2007-07-19 16:41  SIMS源代码\AdminStudentframe.class

     文件       2052  2007-07-19 16:38  SIMS源代码\AdminStudentframe.java

     文件        219  2008-04-18 16:01  SIMS源代码\checkException.class

     文件        559  2007-07-19 22:45  SIMS源代码\ConditionStudentframe$1.class

     文件        637  2007-07-19 22:45  SIMS源代码\ConditionStudentframe$2.class

     文件        558  2007-07-19 22:45  SIMS源代码\ConditionStudentframe$3.class

     文件       1850  2007-07-19 22:45  SIMS源代码\ConditionStudentframe$4.class

     文件        528  2007-07-19 22:45  SIMS源代码\ConditionStudentframe$5.class

     文件       5474  2007-07-19 22:45  SIMS源代码\ConditionStudentframe.class

     文件       6864  2007-07-19 22:45  SIMS源代码\ConditionStudentframe.java

     文件       2391  2007-07-19 17:10  SIMS源代码\DeleteAdminframe$1.class

     文件        658  2007-07-19 17:10  SIMS源代码\DeleteAdminframe$2.class

     文件       1873  2007-07-19 17:10  SIMS源代码\DeleteAdminframe$3.class

     文件        736  2007-07-19 17:10  SIMS源代码\DeleteAdminframe$4.class

     文件        503  2007-07-19 17:10  SIMS源代码\DeleteAdminframe$5.class

     文件       4365  2007-07-19 17:10  SIMS源代码\DeleteAdminframe.class

     文件       6888  2007-07-19 17:10  SIMS源代码\DeleteAdminframe.java

............此处省略57个文件信息

评论

共有 条评论