JToggleButton反转按钮代码2

public class JToggleButtonTest extends JApplet{
public JToggleButtonTest() {
Container contentPane = getContentPane();
ButtonGroup group = new ButtonGroup();

JToggleButton[] buttons = new JToggleButton[] {
new JToggleButton(new ImageIcon("Login.gif")),
new JToggleButton(new ImageIcon("Login.gif")),
new JToggleButton(new ImageIcon("Login.gif")),
new JToggleButton(new ImageIcon("Login.gif")),
new JToggleButton(new ImageIcon("Login.gif")),
new JToggleButton(new ImageIcon("Login.gif")),
};
Box box = Box.createVerticalBox();

for(int i=0; i < buttons.length; ++i) {
group.add(buttons[i]);
box.add(Box.createVerticalStrut(5));
box.add(buttons[i]);

}

box.add(Box.createVerticalStrut(5));

contentPane.add(box);
}
}
展开阅读全文

没有更多推荐了,返回首页