student.java~5~

来自「这个是学生考试系统,里面有完整的代码加数据库SQL server」· JAVA~5~ 代码 · 共 67 行

JAVA~5~
67
字号
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 + =
减小字号Ctrl + -
显示快捷键?