?? kingframe1.java~262~
字號:
package enigma;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import javax.swing.table.*;
import java.awt.Rectangle;
import java.awt.Font;
import java.awt.BorderLayout;
public class kingFrame1 extends JFrame {
kingFrame1 JF;
JPanel contentPane;
Connection con;
String strsql;
Statement ss;
ResultSet result;
ArrayList jtobjsz = new ArrayList();
int num1 = 0;
boolean kingFrame1obj = false;
boolean kks = false;
boolean kkb = false;
JPanel jPanel2 = new JPanel();
CardLayout cardLayout1 = new CardLayout();
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenu1 = new JMenu();
JMenuItem jMenuItem1 = new JMenuItem();
JMenuItem jMenuItem2 = new JMenuItem();
JMenu jMenu2 = new JMenu();
JMenuItem jMenuItem4 = new JMenuItem();
JMenuItem jMenuItem5 = new JMenuItem();
JMenuItem jMenuItem6 = new JMenuItem();
JMenu jMenu3 = new JMenu();
JMenuItem jMenuItem7 = new JMenuItem();
JMenuItem jMenuItem8 = new JMenuItem();
JMenu jMenu4 = new JMenu();
JMenuItem jMenuItem9 = new JMenuItem();
JPanel jPanel1 = new JPanel();
JLabel jLabel1 = new JLabel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JTextField jTextField1 = new JTextField();
JPasswordField jPasswordField1 = new JPasswordField();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JMenuItem jMenuItem10 = new JMenuItem();
JPanel jPanel3 = new JPanel();
String[] strobj3 = {"姓名", "班級", "C語言", "Html", "SQL",
"Java"};
JPanel jPanel4 = new JPanel();
JComboBox jComboBox1 = new JComboBox();
JComboBox jComboBox2;
JLabel jLabel6 = new JLabel();
JTextField jTextField2 = new JTextField();
JLabel jLabel7 = new JLabel();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
JLabel jLabel8 = new JLabel();
JLabel jLabel9 = new JLabel();
JComboBox jComboBox3 = new JComboBox();
JPanel jPanel5 = new JPanel();
JLabel jLabel10 = new JLabel();
JComboBox jComboBox4 = new JComboBox();
JButton jButton6 = new JButton();
JButton jButton7 = new JButton();
JButton jButton8 = new JButton();
JLabel jLabel11 = new JLabel();
JLabel jLabel12 = new JLabel();
JPanel jPanel6 = new JPanel();
JLabel jLabel13 = new JLabel();
JLabel jLabel14 = new JLabel();
JTextField jTextField3 = new JTextField();
JLabel jLabel15 = new JLabel();
JButton jButton9 = new JButton();
JButton jButton10 = new JButton();
JButton jButton11 = new JButton();
JPasswordField jPasswordField2 = new JPasswordField();
JPanel jPanel7 = new JPanel();
JLabel jLabel16 = new JLabel();
JLabel jLabel17 = new JLabel();
JTextField jTextField4 = new JTextField();
JLabel jLabel18 = new JLabel();
JPasswordField jPasswordField3 = new JPasswordField();
JTextField jTextField5 = new JTextField();
JLabel jLabel19 = new JLabel();
JButton jButton12 = new JButton();
JButton jButton13 = new JButton();
JButton jButton14 = new JButton();
JMenuItem jMenuItem11 = new JMenuItem();
JMenuItem jMenuItem12 = new JMenuItem();
JPanel jPanel8 = new JPanel();
JLabel jLabel20 = new JLabel();
JLabel jLabel21 = new JLabel();
JTextField jTextField6 = new JTextField();
JLabel jLabel22 = new JLabel();
JTextField jTextField7 = new JTextField();
JLabel jLabel23 = new JLabel();
JTextField jTextField8 = new JTextField();
JTextField jTextField9 = new JTextField();
JTextField jTextField10 = new JTextField();
JTextField jTextField11 = new JTextField();
JButton jButton15 = new JButton();
JButton jButton16 = new JButton();
JButton jButton17 = new JButton();
JLabel jLabel24 = new JLabel();
JLabel jLabel25 = new JLabel();
JLabel jLabel26 = new JLabel();
JLabel jLabel27 = new JLabel();
JMenuItem jMenuItem3 = new JMenuItem();
JMenuItem jMenuItem13 = new JMenuItem();
JPanel jPanel9 = new JPanel();
JLabel jLabel28 = new JLabel();
JLabel jLabel29 = new JLabel();
JLabel jLabel30 = new JLabel();
JLabel jLabel31 = new JLabel();
JLabel jLabel32 = new JLabel();
JTextField jTextField12 = new JTextField();
JPasswordField jPasswordField4 = new JPasswordField();
JPasswordField jPasswordField5 = new JPasswordField();
JPasswordField jPasswordField6 = new JPasswordField();
JButton jButton18 = new JButton();
JButton jButton19 = new JButton();
JButton jButton20 = new JButton();
BorderLayout borderLayout1 = new BorderLayout();
JScrollPane jScrollPane1 = new JScrollPane();
JScrollPane jScrollPane2 = new JScrollPane();
public kingFrame1() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
JF = this;
zz();
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
//鏈接數(shù)據(jù)庫的方法
void zz() {
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String str =
"jdbc:microsoft:SQLServer://localhost:1433;databasename=enigma;";
con = DriverManager.getConnection(str, "sa", "sa");
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(cardLayout1);
this.setJMenuBar(jMenuBar1);
setSize(new Dimension(400, 300));
setTitle("Frame Title");
jComboBox1.addItem("請選擇");
jComboBox1.addItem("學(xué)生姓名");
jComboBox1.addItem("學(xué)生班級");
jComboBox1.addItem("學(xué)生成績");
jComboBox3.addItem("請選擇科目");
jComboBox3.addItem("C");
jComboBox3.addItem("Html");
jComboBox3.addItem("Sqlserver");
jComboBox3.addItem("Java");
jPanel2.setLayout(null);
jMenu1.setText("使用");
jMenuItem1.setText("查詢學(xué)生信息");
jMenuItem1.addActionListener(new kingFrame1_jMenuItem1_actionAdapter(this));
jMenuItem2.setText("更改學(xué)生信息");
jMenuItem2.addActionListener(new kingFrame1_jMenuItem2_actionAdapter(this));
jMenu2.setText("用戶管理");
jMenuItem4.setText("添加用戶");
jMenuItem4.addActionListener(new kingFrame1_jMenuItem4_actionAdapter(this));
jMenuItem5.setText("刪除用戶");
jMenuItem5.addActionListener(new kingFrame1_jMenuItem5_actionAdapter(this));
jMenuItem6.setText("更換用戶");
jMenuItem6.addActionListener(new kingFrame1_jMenuItem6_actionAdapter(this));
jMenu3.setText("幫助");
jMenuItem7.setText("版本信息");
jMenuItem7.addActionListener(new kingFrame1_jMenuItem7_actionAdapter(this));
jMenuItem8.setText("幫助文檔");
jMenuItem8.addActionListener(new kingFrame1_jMenuItem8_actionAdapter(this));
jMenu4.setText("退出");
jMenuItem9.setText("退出");
jMenuItem9.addActionListener(new kingFrame1_jMenuItem9_actionAdapter(this));
jLabel1.setFont(new java.awt.Font("宋體", Font.PLAIN, 25));
jLabel1.setText("用戶登陸界面");
jLabel1.setBounds(new Rectangle(125, 34, 150, 30));
jButton1.setBounds(new Rectangle(224, 230, 79, 34));
jButton1.setText("重置");
jButton1.addActionListener(new kingFrame1_jButton1_actionAdapter(this));
jButton2.setBounds(new Rectangle(89, 230, 79, 34));
jButton2.setText("提交");
jButton2.addActionListener(new kingFrame1_jButton2_actionAdapter(this));
jTextField1.setBounds(new Rectangle(151, 94, 131, 20));
jPasswordField1.setBounds(new Rectangle(151, 150, 131, 20));
jLabel2.setFont(new java.awt.Font("宋體", Font.PLAIN, 16));
jLabel2.setText("密 碼");
jLabel2.setBounds(new Rectangle(87, 153, 48, 19));
jLabel3.setFont(new java.awt.Font("宋體", Font.PLAIN, 16));
jLabel3.setText("用戶名");
jLabel3.setBounds(new Rectangle(83, 98, 48, 19));
jPanel1.setLayout(null);
jLabel4.setFont(new java.awt.Font("宋體", Font.PLAIN, 25));
jLabel4.setText("歡迎使用學(xué)生管理系統(tǒng)");
jLabel4.setBounds(new Rectangle(69, 46, 261, 47));
jLabel5.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel5.setText("子俊實(shí)驗(yàn)室研發(fā)");
jLabel5.setBounds(new Rectangle(134, 151, 108, 42));
jMenuItem10.setText("登陸");
jMenuItem10.addActionListener(new kingFrame1_jMenuItem10_actionAdapter(this));
jPanel4.setLayout(null);
jComboBox1.setBounds(new Rectangle(148, 21, 134, 22));
jComboBox1.addActionListener(new kingFrame1_jComboBox1_actionAdapter(this));
jLabel6.setText("請選擇更改類型");
jLabel6.setBounds(new Rectangle(51, 21, 87, 24));
jTextField2.setBounds(new Rectangle(153, 157, 133, 29));
jLabel7.setText("請輸入更改內(nèi)容");
jLabel7.setBounds(new Rectangle(48, 158, 90, 30));
jButton3.setBounds(new Rectangle(54, 214, 75, 34));
jButton3.setText("提交");
jButton3.addActionListener(new kingFrame1_jButton3_actionAdapter(this));
jButton4.setBounds(new Rectangle(174, 212, 75, 38));
jButton4.setText("重置");
jButton4.addActionListener(new kingFrame1_jButton4_actionAdapter(this));
jButton5.setBounds(new Rectangle(294, 212, 75, 36));
jButton5.setText("退出");
jButton5.addActionListener(new kingFrame1_jButton5_actionAdapter(this));
jLabel8.setText("請選擇更改的學(xué)生");
jLabel8.setBounds(new Rectangle(39, 64, 99, 28));
jLabel9.setText("請選擇成績科目");
jLabel9.setBounds(new Rectangle(48, 113, 86, 31));
jComboBox3.setBounds(new Rectangle(150, 116, 137, 23));
jPanel5.setLayout(null);
jLabel10.setText("請選擇您要?jiǎng)h除信息的學(xué)生");
jLabel10.setBounds(new Rectangle(23, 110, 145, 44));
jComboBox4.setBounds(new Rectangle(190, 119, 182, 28));
jButton6.setBounds(new Rectangle(55, 218, 70, 29));
jButton6.setText("提交");
jButton6.addActionListener(new kingFrame1_jButton6_actionAdapter(this));
jButton7.setBounds(new Rectangle(162, 217, 70, 29));
jButton7.setText("重置");
jButton7.addActionListener(new kingFrame1_jButton7_actionAdapter(this));
jButton8.setBounds(new Rectangle(268, 216, 70, 29));
jButton8.setText("退出");
jButton8.addActionListener(new kingFrame1_jButton8_actionAdapter(this));
jLabel11.setFont(new java.awt.Font("宋體", Font.PLAIN, 15));
jLabel11.setText("此項(xiàng)為不可恢復(fù)操作!請用戶慎重選擇");
jLabel11.setBounds(new Rectangle(67, 60, 256, 31));
jLabel12.setFont(new java.awt.Font("宋體", Font.PLAIN, 20));
jLabel12.setText("友情提示");
jLabel12.setBounds(new Rectangle(153, 16, 85, 29));
jPanel6.setLayout(null);
jLabel13.setFont(new java.awt.Font("宋體", Font.PLAIN, 18));
jLabel13.setText("請輸入帳戶");
jLabel13.setBounds(new Rectangle(55, 97, 94, 15));
jLabel14.setFont(new java.awt.Font("宋體", Font.PLAIN, 18));
jLabel14.setText("請輸入密碼");
jLabel14.setBounds(new Rectangle(57, 151, 92, 15));
jTextField3.setBounds(new Rectangle(182, 89, 140, 24));
jLabel15.setFont(new java.awt.Font("宋體", Font.PLAIN, 25));
jLabel15.setText("新用戶注冊");
jLabel15.setBounds(new Rectangle(123, 25, 131, 37));
jButton9.setBounds(new Rectangle(54, 210, 69, 36));
jButton9.setText("提交");
jButton9.addActionListener(new kingFrame1_jButton9_actionAdapter(this));
jButton10.setBounds(new Rectangle(163, 210, 69, 36));
jButton10.setText("重置");
jButton10.addActionListener(new kingFrame1_jButton10_actionAdapter(this));
jButton11.setBounds(new Rectangle(272, 210, 69, 36));
jButton11.setText("退出");
jButton11.addActionListener(new kingFrame1_jButton11_actionAdapter(this));
jPasswordField2.setBounds(new Rectangle(182, 147, 140, 24));
jPanel7.setLayout(null);
jLabel16.setFont(new java.awt.Font("宋體", Font.PLAIN, 26));
jLabel16.setText("刪除用戶");
jLabel16.setBounds(new Rectangle(135, 15, 110, 47));
jLabel17.setText("請輸入要?jiǎng)h除的用戶名");
jLabel17.setBounds(new Rectangle(14, 73, 130, 35));
jTextField4.setBounds(new Rectangle(165, 82, 192, 26));
jLabel18.setText("請輸入您的帳號");
jLabel18.setBounds(new Rectangle(26, 122, 98, 27));
jPasswordField3.setBounds(new Rectangle(165, 173, 192, 26));
jTextField5.setBounds(new Rectangle(165, 127, 192, 26));
jLabel19.setText("請輸入您的密碼");
jLabel19.setBounds(new Rectangle(24, 174, 99, 21));
jButton12.setBounds(new Rectangle(36, 239, 86, 27));
jButton12.setText("確定");
jButton12.addActionListener(new kingFrame1_jButton12_actionAdapter(this));
jButton13.setBounds(new Rectangle(265, 238, 86, 27));
jButton13.setText("退出");
jButton13.addActionListener(new kingFrame1_jButton13_actionAdapter(this));
jButton14.setBounds(new Rectangle(150, 239, 86, 27));
jButton14.setText("重置");
jButton14.addActionListener(new kingFrame1_jButton14_actionAdapter(this));
jMenuItem11.setText("記事本");
jMenuItem11.addActionListener(new kingFrame1_jMenuItem11_actionAdapter(this));
jMenuItem12.setText("添加學(xué)生信息");
jMenuItem12.addActionListener(new kingFrame1_jMenuItem12_actionAdapter(this));
jLabel20.setFont(new java.awt.Font("宋體", Font.PLAIN, 25));
jLabel20.setText("添加學(xué)生信息");
jLabel20.setBounds(new Rectangle(112, 26, 152, 30));
jPanel8.setLayout(null);
jLabel21.setText("請輸入學(xué)生姓名");
jLabel21.setBounds(new Rectangle(24, 78, 88, 22));
jTextField6.setBounds(new Rectangle(127, 82, 80, 20));
jLabel22.setText("請輸入學(xué)生班級");
jLabel22.setBounds(new Rectangle(215, 87, 85, 15));
jTextField7.setBounds(new Rectangle(308, 82, 80, 20));
jLabel23.setText("請輸入學(xué)生各科成績");
jLabel23.setBounds(new Rectangle(22, 119, 116, 15));
jTextField8.setBounds(new Rectangle(98, 145, 83, 20));
jTextField9.setBounds(new Rectangle(252, 145, 83, 20));
jTextField10.setBounds(new Rectangle(95, 187, 83, 20));
jTextField11.setBounds(new Rectangle(254, 190, 83, 20));
jButton15.setBounds(new Rectangle(38, 254, 87, 23));
jButton15.setText("提交");
jButton15.addActionListener(new kingFrame1_jButton15_actionAdapter(this));
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -