📄 icons.java
字号:
import javax.swing.*;
public class Icons extends JFrame {
JButton[] buttons = new JButton[24];
public Icons() {
super("Icons");
setSize(335, 318);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel pane = new JPanel();
ImageIcon icon = new ImageIcon("3dman.gif");
for (int i = 0; i < 24; i++) {
buttons[i] = new JButton(icon);
pane.add(buttons[i]);
}
setContentPane(pane);
show();
}
public static void main(String[] arguments) {
Icons ike = new Icons();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -