welcome.java

来自「用JAVA+SQL编写的一个教学管理软件」· Java 代码 · 共 41 行

JAVA
41
字号
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


public class Welcome extends JFrame{
	private JLabel lbl_hello;
	private JButton btn_enter;

	public Welcome(){
		super("欢迎登入教学管理系统");
		Container container=getContentPane();
		container.setLayout(new FlowLayout());
		Icon pic=new ImageIcon("center_student.jpg");
		lbl_hello=new JLabel();
		lbl_hello.setIcon(pic);
		lbl_hello.setToolTipText("This is Shanghai University of Electric Power");
		container.add(lbl_hello);
		btn_enter=new JButton();
		btn_enter.setText("欢迎登入教学管理系统");
		btn_enter.setFont(new Font("Serif",Font.BOLD+Font.ITALIC,22));
		container.add(btn_enter);
		setSize(586,320);
		setLocation(275,240);
		setVisible(true);
		
		btn_enter.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				dispose();
				School sch=new School();
			}
		});
		
	}
	
	public static void main(String args[]){
		Welcome wel=new Welcome();
		wel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
	}
}

⌨️ 快捷键说明

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