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

📄 alphabet.java

📁 21天学JAVA源代码
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class Alphabet extends JFrame {
    JButton a = new JButton("Alibi");
    JButton b = new JButton("Burglar");
    JButton c = new JButton("Corpse");
    JButton d = new JButton("Deadbeat");
    JButton e = new JButton("Evidence");
    JButton f = new JButton("Fugitive");

    Alphabet() {
        super("Alphabet");
        setSize(360, 120);
        JPanel pane = new JPanel();
        FlowLayout lm = new FlowLayout(FlowLayout.LEFT);
        pane.setLayout(lm);
        pane.add(a);
        pane.add(b);
        pane.add(c);
        pane.add(d);
        pane.add(e);
        pane.add(f);
        setContentPane(pane);
    }

    public static void main(String[] arguments) {
        JFrame frame = new Alphabet();
        ExitWindow exit = new ExitWindow();
        frame.addWindowListener(exit);
        frame.show();
    }
}

class ExitWindow extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }
}

⌨️ 快捷键说明

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