⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 学生选课管理系统
💻 JAVA
字号:
package main;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class Main extends JFrame implements ActionListener{
	JButton jbs;
	JButton jbadd;
	JButton jexit;
	public Main(){
		init();
	}
	private void init() {
		this.setLayout(null);
		jbs=new JButton("查询所有学生信息"	);
		jbadd=new JButton("添加学生信息");
		jexit=new JButton("退出");
		jbs.setBounds(50,40,150,40);
		jbadd.setBounds(210,40,150,40);
		this.jbs.addActionListener(this);
		this.jbadd.addActionListener(this);
		this.jexit.addActionListener(this);
		this.add(jbs);
		this.add(jbadd);
		this.add(jexit);
		this.setTitle("主窗体");
		this.setSize(400,300);
		this.setLocationRelativeTo(this);
		this.setVisible(true);
		this.setResizable(false);
	}
	public void actionPerformed(ActionEvent arg0) {
		String s=arg0.getActionCommand();
		if(s.equals("退出")){
			System.exit(0);
		}else if(s.equals("查询所有学生信息")){
			new LookupAllStudents();
		}else{
			new AddStudent();
		}
		
	}
	public static void main(String []args){
		new Main();
	}
}

⌨️ 快捷键说明

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