?? student.java~5~
字號:
package testsystem;
import java.awt.*;
import javax.swing.*;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Student extends JFrame {
private ImageIcon im1 = new ImageIcon("img\\statistics.png");
public Student() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
jButton1.setBounds(new Rectangle(69, 64, 95, 43));
jButton1.setIcon(im1);
jButton1.addActionListener(new Student_jButton1_actionAdapter(this));
jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
jLabel2.setText("計 算 器");
this.getContentPane().setBackground(new Color(226, 176, 226));
this.setResizable(false);
setTitle("學員操作");
jLabel2.setBounds(new Rectangle(65, 38, 97, 19));
jLabel1.setBackground(new Color(226, 161, 226));
this.getContentPane().add(jLabel2);
this.getContentPane().add(jLabel1);
this.getContentPane().add(jButton1);
jLabel1.setForeground(Color.red);
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setText("考試學員只可以使用計算器");
jLabel1.setBounds(new Rectangle(26, 116, 181, 57));
}
public static void main(String[] args) {
Student student = new Student();
}
JButton jButton1 = new JButton();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
public void jButton1_actionPerformed(ActionEvent e) {
JsqFrom jsq=new JsqFrom();
jsq.setBounds(190, 140, 400, 370);
this.setVisible(false);
jsq.show();
}
}
class Student_jButton1_actionAdapter implements ActionListener {
private Student adaptee;
Student_jButton1_actionAdapter(Student adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -