📄 test.java
字号:
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
public class Test extends JApplet {
public Test() {
Container contentPane = getContentPane();
Box yaxis = new Box(BoxLayout.Y_AXIS);
Box xaxis = new Box(BoxLayout.X_AXIS);
contentPane.setLayout(new FlowLayout());
xaxis.add(new JButton(new ImageIcon("reach.gif")));
xaxis.add(new JButton(new ImageIcon("punch.gif")));
xaxis.add(Box.createRigidArea(new Dimension(25,0)));
xaxis.add(new JButton(new ImageIcon("open_hand.gif")));
Box.createRigidArea(new Dimension(0,25));
yaxis.add(new JButton(new ImageIcon("ladybug.gif")));
yaxis.add(Box.createVerticalGlue());
yaxis.add(new JButton(new ImageIcon("crab.gif")));
yaxis.add(new JButton(new ImageIcon("frog.gif")));
yaxis.add(new JButton(new ImageIcon("snail.gif")));
contentPane.add(xaxis);
contentPane.add(yaxis);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -