⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instructions.java~3~

📁 学生信息管理系统,包括成绩查询,成绩排序,用ACCESS做数据库连接
💻 JAVA~3~
字号:
package Chapter1;import java.io.*;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.sql.*;import java.awt.Rectangle;import java.awt.Font;public class Instructions extends JFrame implements ActionListener{  public static final int WIDTH=400;  public static final int HEIGHT=400;  JLabel jLabel1 = new JLabel();  JButton jButton1 = new JButton();  public Instructions()  {    setSize(WIDTH,HEIGHT);    setTitle("使用说明");    Container contentPane=getContentPane();    contentPane.setBackground(Color.green);    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  public void actionPerformed(ActionEvent e)  {    if(e.getActionCommand().equals("提交"))       { //用于获取用户输入的信息          try          { String url="jdbc:odbc:MySecondAccess";            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");            Connection con=DriverManager.getConnection(url,"","");            Statement stmt=con.createStatement();            String  SQLOrder="INSERT INTO BasicInformation ";            stmt.executeUpdate(SQLOrder);            stmt.close();            con.close();          }          catch(Exception ex)          {            System.out.println(ex.getStackTrace());            System.out.println(ex.getMessage());          }       }     else if (e.getActionCommand().equals("重置"))     {     }     else if  (e.getActionCommand().equals("返回"))     {       this.setVisible(false);       ManagerInterface n=new ManagerInterface();       n.setVisible(true);     }  }  public static void main(String[] args)  {     Instructions n=new Instructions();      n.setVisible(true);  }  private void jbInit() throws Exception {    jLabel1.setFont(new java.awt.Font("Dialog", 1, 13));    jLabel1.setRequestFocusEnabled(true);    jLabel1.setText("此系统用于管理学生信息,包括学生信息的输入和查询等功能!");    jLabel1.setBounds(new Rectangle(8, 56, 376, 152));    this.getContentPane().setLayout(null);    jButton1.setBounds(new Rectangle(169, 242, 73, 25));    jButton1.setFont(new java.awt.Font("Dialog", 1, 13));    jButton1.setText("返回");    this.getContentPane().add(jLabel1, null);    this.getContentPane().add(jButton1, null);    jButton1.addActionListener(this);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -