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

📄 afterload.java

📁 使用java编写的一个学生选课系统
💻 JAVA
字号:
package Srs;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import Srs.GetName;
import Srs.AboutCourse;
import Srs.Selected;
public class AfterLoad extends JFrame implements ActionListener{

	private JTextArea textArea;
	/**
	 * Launch the application
	 * @param args
	 */
	private GetName getName = new GetName();
	private String Id;
	private String Name;
	private JButton button;
	private JButton button_1;
	private JButton button_2;
	private JButton button_3;
	private JButton button_4;
	/**
	 * Create the frame
	 */
	public AfterLoad(String newId){
		super();
		
		getContentPane().setFont(new Font("", Font.PLAIN, 18));
		Id = newId;
		Name = getName.getName(newId);
		getContentPane().setLayout(null);
		setBounds(100, 100, 500, 375);
		this.setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		final JLabel label = new JLabel();
		label.setFont(new Font("Dialog", Font.BOLD, 22));
		label.setText("欢迎你,");
		label.setBounds(156, 35, 96, 31);
		getContentPane().add(label);

		final JLabel label_1 = new JLabel();
		label_1.setFont(new Font("Dialog", Font.BOLD, 14));
		label_1.setText("");
		label_1.setBounds(242, 32, 96, 42);
		getContentPane().add(label_1);
		label_1.setText(getName.getName(newId)+"同学");

		button = new JButton();
		button.addActionListener(this); 
		button.setText("个人信息");
		button.setBounds(47, 119, 158, 31);
		button.addActionListener(this);
		getContentPane().add(button);

		button_1 = new JButton();
		button_1.setText("选   课");
		button_1.setBounds(47, 230, 158, 31);
		getContentPane().add(button_1);
		button_1.addActionListener(this);

		button_3 = new JButton();
		button_3.setText("课程信息");
		button_3.setBounds(47, 193, 158, 31);
		button_3.addActionListener(this);
		getContentPane().add(button_3);

		button_4 = new JButton();
		button_4.setText("修改密码");
		button_4.setBounds(47, 156, 158, 31);
		button_4.addActionListener(this);
		getContentPane().add(button_4);

		final JButton button_5 = new JButton();
		button_5.setText("注销");
		button_5.setBounds(344, 46, 79, 17);
		getContentPane().add(button_5);

		textArea = new JTextArea();
		textArea.setText("                 注意:\n\n"+
				"   这是学生注册系统测试版,\n\n" +
				"请大家勇于尝试," +
				"多找BUG");
		textArea.setBounds(274, 117, 171, 197);
		textArea.setEditable(false);
		getContentPane().add(textArea);

		final JLabel label_2 = new JLabel();
		label_2.setFont(new Font("", Font.BOLD, 18));
		label_2.setText("通知公告");
		label_2.setBounds(315, 80, 96, 31);
		getContentPane().add(label_2);

		button_2 = new JButton();
		button_2.setText("退   出");
		button_2.addActionListener(this);
		button_2.setBounds(47, 267, 158, 28);
		getContentPane().add(button_2);
		//
	}
	public void actionPerformed(ActionEvent e){
		if(e.getSource() == button_1){
			AboutCourse aboutCourse = new AboutCourse(Id,Name);
			aboutCourse.setVisible(true);
			this.dispose();
		}
		else if(e.getSource() == button_3){
			Selected selected = new Selected(Id);
			selected.setVisible(true);
			this.dispose();
		}
		else if(e.getSource() == button_2){
			MajorSrs major = new MajorSrs();
			major.setVisible(true);
			this.dispose();
		}
		else if(e.getSource() == button_4){
			NewPassword newone = new NewPassword(Id); 
			newone.setVisible(true);
			this.dispose();
		}
		else if(e.getSource() == button){
			NewStudent newone = new NewStudent(Id); 
			newone.setVisible(true);
			this.dispose();
		}
	}


}

⌨️ 快捷键说明

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