📄 teacher.java
字号:
package com.window.teacher;
import java.awt.Color;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Panel;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableModel;
import com.window.login.Login;
import com.window.student.CheckBoxItem;
import java.awt.GridBagLayout;
import java.awt.ScrollPane;
import java.awt.Label;
public class Teacher extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JLabel jLabel1 = null;
private JToolBar jToolBar = null;
private JToolBar jToolBar1 = null;
private JLabel jLabel = null;
private JLabel usernNamejLabel2 = null;
private Panel studentManagejPanel = null; // @jve:decl-index=0:visual-constraint="0,1971"
private JButton lookStudentjButton = null;
private JTable studentmanagejTable = null;
private Data data=new Data(); // @jve:decl-index=0:
private JScrollPane jScrollPane = null;
private JTable jTable2 = null;
private JButton StudentUpdatajButton = null;
private JButton studentdeletejButton = null;
private JButton addStudentjButton = null;
private JTextField studentNojTextField = null;
private JTextField studentNamejTextField = null;
private JTextField studentClassjTextField = null;
private JTextField studentPasswordjTextField = null;
private JLabel jLabel2 = null;
private JLabel jLabel3 = null;
private JLabel jLabel4 = null;
private JLabel jLabel5 = null;
private Panel courseManagejPanel = null; // @jve:decl-index=0:visual-constraint="2,586"
private JScrollPane courseManagejScrollPane1 = null;
private JTable courseManagejTable = null;
private JButton lookcoursejButton = null;
private JTextField courseNojTextField = null;
private JTextField courseNamejTextField = null;
private JTextField courseTypejTextField = null;
private JTextField courseCreditjTextField = null;
private JTextField courseTeacherjTextField = null;
private JTextField courseXibujTextField = null;
private JTextField courseTimejTextField = null;
private JTextField courseRestrictPeoplejTextField = null;
private JLabel jLabel6 = null;
private JLabel jLabel7 = null;
private JLabel jLabel8 = null;
private JLabel jLabel9 = null;
private JLabel jLabel10 = null;
private JLabel jLabel11 = null;
private JLabel jLabel12 = null;
private JLabel jLabel13 = null;
private JButton courseAddjButton = null;
private JButton courseUpdatejButton = null;
private JButton courseDeletejButton = null;
private JMenuBar tooljJMenuBar = null;
private JMenu jMenu = null;
private JMenu jMenu1 = null;
private JMenu jMenu2 = null;
private JMenu jMenu3 = null;
private JMenuItem exitjMenuItem = null;
private JMenuItem studentManagejMenuItem = null;
private JMenuItem choiceCourseMassagejMenuItem = null;
private JMenuItem helpjMenuItem = null;
private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="7,2334"
private JButton querenjButton = null;
private JButton openClassjButton = null;
private JButton pingfenjButton = null;
private JButton studnetMassagejButton = null;
private JMenu queRenMangerjMenu4 = null;
private JMenuItem queRenjMenuItem = null;
private JMenuItem StarPanejMenuItem = null;
private Panel queRenXuanKepanel = null; // @jve:decl-index=0:visual-constraint="-4,1566"
private JScrollPane chengjijScrollPane11 = null;
private JButton jButton = null;
private JList studentjList = null;
private JLabel jLabel14 = null;
private JTextField StudentcourseNojTextField = null;
private JLabel jLabel15 = null;
private JCheckBox jCheckBox = null;
private JButton jButton1 = null;
private JButton jButton2 = null;
private Panel chengjipanel = null; // @jve:decl-index=0:visual-constraint="6,2790"
private JTable chengjijTable = null; // @jve:decl-index=0:visual-constraint="807,191"
private JLabel jLabel16 = null;
private JTextField chengjicourseNojTextField = null;
private JButton jButton3 = null;
private JLabel jLabel17 = null;
private JLabel jLabel18 = null;
private JLabel jLabel19 = null;
private JLabel jLabel20 = null;
private JButton jButton4 = null;
private JTextField chengjiSutendsNojTextField1 = null;
private JTextField chengjiStudentNamejTextField1 = null;
private JTextField studentclassjTextField1 = null;
private JTextField chegnjijTextField1 = null;
private JScrollPane chengjijScrollPane1 = null;
private JMenu jMenu4 = null;
private JMenuItem chengjijMenuItem = null;
private JLabel jLabel21 = null;
private JTextField classNojTextField = null;
private JLabel jLabel22 = null;
private JLabel jLabel23 = null;
private JLabel jLabel24 = null;
private JLabel jLabel25 = null;
private JLabel jLabel26 = null;
private JLabel jLabel27 = null;
private Panel userMangerpanel = null; // @jve:decl-index=0:visual-constraint="6,2378"
private JLabel jLabel51 = null;
private Label label = null;
private JTextField passwordjTextField = null;
private JTextField newPasswordjTextField = null;
private JButton okjButton5 = null;
private JButton jButton5 = null;
/**
* This is the default constructor
*/
public String teacherName=null;
private JMenu jMenu5 = null;
private JMenuItem passwordjMenuItem = null;
private JButton zhuxiaojButton6 = null;
private JButton exitjButton6 = null;
private JLabel jLabel28 = null;
private JLabel jLabel29 = null;
private JMenuItem zhuxiaojMenuItem = null;
public Teacher(String Name) {
super();
initialize();
teacherName=Name;
usernNamejLabel2.setText(Name);
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(759, 508);
this.setJMenuBar(getTooljJMenuBar());
this.setContentPane(getJContentPane());
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
this.setBounds((screenSize.width-this.getWidth())/2,(screenSize.height-this.getHeight())/2,this.getWidth(), this.getHeight());
this.setTitle("学生选课系统");
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jLabel29 = new JLabel();
jLabel29.setBounds(new Rectangle(0, 41, 750, 388));
jLabel29.setIcon(new ImageIcon(getClass().getResource("/image/main.gif")));
jLabel29.setText("JLabel");
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(2, 2, 757, 30));
jLabel1.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 18));
jLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
jLabel1.setIcon(new ImageIcon(getClass().getResource("/image/QQ\u622a\u56fe\u672a\u547d\u540d1.gif")));
jLabel1.setText("\u6b22\u8fce\u4f7f\u7528\u5b66\u751f\u9009\u8bfe\u7cfb\u7edf");
jLabel1.setComponentOrientation(ComponentOrientation.UNKNOWN);
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(jLabel1, null);
jContentPane.add(getJToolBar(), null);
jContentPane.add(getJToolBar1(), null);
jContentPane.add(getJPanel(), null);
jContentPane.add(jLabel29, null);
}
return jContentPane;
}
/**
* This method initializes jToolBar
*
* @return javax.swing.JToolBar
*/
private JToolBar getJToolBar() {
if (jToolBar == null) {
jToolBar = new JToolBar();
jToolBar.setBounds(new Rectangle(0, 34, 749, 8));
}
return jToolBar;
}
/**
* This method initializes jToolBar1
*
* @return javax.swing.JToolBar
*/
private JToolBar getJToolBar1() {
if (jToolBar1 == null) {
usernNamejLabel2 = new JLabel();
usernNamejLabel2.setText("XXX");
jLabel = new JLabel();
jLabel.setText("用户:");
jToolBar1 = new JToolBar();
jToolBar1.setBounds(new Rectangle(1, 430, 750, 21));
jToolBar1.add(jLabel);
jToolBar1.add(usernNamejLabel2);
}
return jToolBar1;
}
/**
* This method initializes studentManagejPanel
*
* @return javax.swing.JPanel
*/
private Panel getStudentManagejPanel() {
if (studentManagejPanel == null) {
jLabel25 = new JLabel();
jLabel25.setBounds(new Rectangle(571, 338, 176, 45));
jLabel25.setFont(new Font("\u534e\u6587\u884c\u6977", Font.BOLD, 36));
jLabel25.setText("学生管理");
jLabel24 = new JLabel();
jLabel24.setBounds(new Rectangle(182, 11, 87, 18));
jLabel24.setText("学生列表");
jLabel21 = new JLabel();
jLabel21.setBounds(new Rectangle(549, 29, 86, 18));
jLabel21.setText("按班级编号:");
jLabel5 = new JLabel();
jLabel5.setBounds(new Rectangle(502, 172, 38, 18));
jLabel5.setText("密码");
jLabel4 = new JLabel();
jLabel4.setBounds(new Rectangle(479, 143, 61, 18));
jLabel4.setText("班级编号");
jLabel3 = new JLabel();
jLabel3.setBounds(new Rectangle(491, 113, 49, 18));
jLabel3.setText("姓名:");
jLabel2 = new JLabel();
jLabel2.setBounds(new Rectangle(502, 84, 38, 18));
jLabel2.setText("学号");
studentManagejPanel = new Panel();
studentManagejPanel.setLayout(null);
studentManagejPanel.setBounds(new Rectangle(0, 37, 750, 392));
studentManagejPanel.add(getLookStudentjButton(), null);
//studentManagejPanel.add(getStudentmanagejTable(), null);
studentManagejPanel.add(getJScrollPane(), null);
studentManagejPanel.add(getStudentUpdatajButton(), null);
studentManagejPanel.add(getStudentdeletejButton(), null);
studentManagejPanel.add(getAddStudentjButton(), null);
studentManagejPanel.add(getStudentNojTextField(), null);
studentManagejPanel.add(getStudentNamejTextField(), null);
studentManagejPanel.add(getStudentClassjTextField(), null);
studentManagejPanel.add(getStudentPasswordjTextField(), null);
studentManagejPanel.add(jLabel2, null);
studentManagejPanel.add(jLabel3, null);
studentManagejPanel.add(jLabel4, null);
studentManagejPanel.add(jLabel5, null);
studentManagejPanel.add(jLabel21, null);
studentManagejPanel.add(getClassNojTextField(), null);
studentManagejPanel.add(jLabel24, null);
studentManagejPanel.add(jLabel25, null);
}
return studentManagejPanel;
}
/**
* This method initializes lookStudentjButton
*
* @return javax.swing.JButton
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -