?? teacher.java~11~
字號:
package testsystem;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Teacher extends JFrame {
private ImageIcon im1 = new ImageIcon("img\\admin.png");
private ImageIcon im2 = new ImageIcon("img\\readerinfo.png");
private ImageIcon im3 = new ImageIcon("img\\password.png");
private ImageIcon im4 = new ImageIcon("img\\borrowbook.png");
private ImageIcon im5 = new ImageIcon("img\\renewbook.png");
JButton jb1 = new JButton();
JButton jb2 = new JButton();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JButton jb3 = new JButton();
JButton jb4 = new JButton();
JButton jb5 = new JButton();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
tjStu Stu=new tjStu();
public Teacher() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
jb1.setBounds(new Rectangle(57, 51, 81, 46));
jb1.setIcon(im1);
jb1.addActionListener(new Teacher_jButton1_actionAdapter(this));
jb3.setBounds(new Rectangle(139, 129, 84, 48));
jb3.setIcon(im3);
jb4.setBounds(new Rectangle(58, 207, 80, 45));
jb4.setIcon(im4);
jb5.setBounds(new Rectangle(230, 207, 79, 46));
jb5.setIcon(im5);
jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
setTitle("教師管理");
jLabel3.setText("修 改 密 碼");
jLabel3.setBounds(new Rectangle(141, 105, 83, 25));
jLabel4.setHorizontalAlignment(SwingConstants.CENTER);
jLabel4.setText("添 加 試 題");
jLabel4.setBounds(new Rectangle(59, 181, 76, 23));
jLabel5.setHorizontalAlignment(SwingConstants.CENTER);
jLabel5.setText("刪 除 試 題");
jLabel5.setBounds(new Rectangle(231, 183, 76, 22));
jb2.addActionListener(new Teacher_jb2_actionAdapter(this));
this.getContentPane().add(jb1);
jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
jLabel2.setText("刪 除 用 戶");
jLabel2.setBounds(new Rectangle(230, 26, 81, 22));
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setText("添 加 用 戶");
jLabel1.setBounds(new Rectangle(57, 27, 79, 22));
this.getContentPane().add(jb2);
this.getContentPane().add(jLabel3);
this.getContentPane().add(jb5);
this.getContentPane().add(jb4);
this.getContentPane().add(jLabel4);
this.getContentPane().add(jLabel5);
this.getContentPane().add(jb3);
this.getContentPane().add(jLabel2);
this.getContentPane().add(jLabel1);
jb2.setBounds(new Rectangle(229, 51, 82, 47));
jb2.setIcon(im2);
}
public static void main(String[] args) {
Teacher teacher = new Teacher();
}
public void jButton1_actionPerformed(ActionEvent e) {
Stu.setBounds(190, 140, 400, 298);
this.setVisible(false);
Stu.show();
}
public void jb2_actionPerformed(ActionEvent e) {
DelFrom del=new DelFrom();
del.setBounds(190,140,376,300);
this.setVisible(false);
del.show();
}
}
class Teacher_jb2_actionAdapter implements ActionListener {
private Teacher adaptee;
Teacher_jb2_actionAdapter(Teacher adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jb2_actionPerformed(e);
}
}
class Teacher_jButton1_actionAdapter implements ActionListener {
private Teacher adaptee;
Teacher_jButton1_actionAdapter(Teacher adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -