📄 test.java
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test extends JApplet {
public Test() {
Container contentPane = getContentPane();
Icon icon = new ImageIcon("bulb.gif");
JRadioButton[] radioButtons = new JRadioButton[] {
new JRadioButton(),
new JRadioButton(icon),
new JRadioButton(icon, true),
new JRadioButton("idea!"),
new JRadioButton("idea!",true),
new JRadioButton("idea!",icon),
new JRadioButton("idea!",icon, true)
};
contentPane.setLayout(new FlowLayout());
for(int i=0; i < radioButtons.length; ++i) {
radioButtons[i].setBorderPainted(true);
contentPane.add(radioButtons[i]);
if(radioButtons[i].getIcon() != null) {
System.out.println("setting selected icon");
radioButtons[i].setSelectedIcon(
new ImageIcon("bulb_bright.gif"));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -