teasearchtcourse.java

来自「班级管理系统」· Java 代码 · 共 58 行

JAVA
58
字号
package lab.lab;

import javax.swing.*;

import java.awt.*;
import java.awt.event.*;

public class TeaSearchTcourse extends JFrame implements ActionListener {
	Container contentPane;

	Dimension faceSize = new Dimension(300, 100);

	JLabel jLabel1 = new JLabel();

	JTextField tcourse = new JTextField(8);

	JButton searchInfo = new JButton();

	TeaSearchTcourse() {
		this.setTitle("按教师专业查询");
		this.setResizable(false);
		try {
			Init();
		} catch (Exception e) {
			e.printStackTrace();
		}
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		this.setLocation((int) (screenSize.width - 400) / 2,
				(int) (screenSize.height - 300) / 2+45);
	}

	private void Init() {
		this.setSize(faceSize);
		contentPane = this.getContentPane();
		contentPane.setLayout(new FlowLayout());
		jLabel1.setText("请输入教师专业");
		jLabel1.setFont(new Font("Dialog", 0, 12));
		contentPane.add(jLabel1);
		tcourse.setText(null);
		tcourse.setFont(new Font("Dialog", 0, 12));
		contentPane.add(tcourse);
		searchInfo.setText("确定");
		searchInfo.setFont(new Font("Dialog", 0, 12));
		contentPane.add(searchInfo);
		searchInfo.addActionListener(this);
	}

	public void actionPerformed(ActionEvent e) {
		Object obj = e.getSource();
		if (obj == searchInfo) {
			ResultStudent rT = new ResultStudent("tcourse", tcourse.getText());
			this.dispose();
		}

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?