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

📄 about.java

📁 一个简单的学生信息查询系统
💻 JAVA
字号:
//About.java 

import java.awt.*; 
import java.awt.event.*; 
import javax.swing.*; 

public class About extends JFrame { 
    JLabel label; 

    JButton button; 

    // 生成一个窗口 
    public About() { 
        super("关于"); 
        setSize(250, 115); 
        setAlwaysOnTop(true); 
        label = new JLabel(); 
        label.setText("制作者:赵坤"); 
        button = new JButton(); 
        button.setText("确定"); 
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 

        button.addActionListener(new ActionListener() { 
            public void actionPerformed(ActionEvent e) { 
                setVisible(false); 
            } 
        }); 

        Container con = getContentPane(); 
        con.setLayout(null); 
        label.setBounds(85, 10, 82, 25); 
        button.setBounds(95, 55, 60, 25); 
        con.add(label); 
        con.add(button); 

        // 将窗口置于屏幕中央 
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 
        Dimension frameSize = this.getSize(); 
        if (frameSize.height > screenSize.height) { 
            frameSize.height = screenSize.height; 
        } 
        if (frameSize.width > screenSize.width) { 
            frameSize.width = screenSize.width; 
        } 
        setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); 
        setResizable(false); 
        setVisible(true); 
    } 
} 

⌨️ 快捷键说明

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