JRadioButton的用法
来源:互联网 发布:js中offset函数 编辑:程序博客网 时间:2024/04/30 15:49
JRadioButton用法
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.FlowLayout;
public class JRadioButtonDemo
{
public static void main(String[] args)
{
JRadioButton red, white, cyan;
red = new JRadioButton ("red");
white = new JRadioButton ("white");
cyan = new JRadioButton ("cyan");
ButtonGroup group = new ButtonGroup ();
group.add (red);
group.add (white);
group.add (cyan);
JPanel panel = new JPanel (new FlowLayout (FlowLayout.CENTER, 1, 0));
panel.setBackground (Color.white);
panel.setPreferredSize (new Dimension (200,50));
panel.add (red);
panel.add (white);
panel.add (cyan);
JFrame frame = new JFrame("JRadioButtonDemo");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
frame.setContentPane(panel);
frame.pack();
frame.show();
}
}
- JRadioButton的用法
- Swing中JRadioButton多选框的用法
- java ButtonGroup及JRadioButton用法
- JRadioButton的使用
- JRadioButton
- jRadioButton
- 一个支持为JRadioButton绑定值的类,继承并扩展JRadioButton
- [Java GUI] Swing中JList和JRadioButton的联合使用
- Java单选按钮JRadioButton取消选择状态的方法
- 单选与复选控件JRadioButton与JCheckBox的使用
- JRadioButton示例
- JRadioButton Cell
- GUI--JRadioButton
- JCheckBox,JRadioButton
- Java复选框JCheckBox和单选按钮JRadioButton用法详解
- java图像界面开发简单实例-JRadioButton、JCheckBox、JLabel的应用
- Java JRadioButton ButtonGroup
- jcheckbox 和JRadioButton
- Visual C#编程入门之C#的程序结构
- 用Visual C#打造多页面网页浏览器
- static final 要点
- 用C#和本地Windows API操纵系统菜单(1)
- 用C#和本地Windows API操纵系统菜单(2)
- JRadioButton的用法
- 用C#和本地Windows API操纵系统菜单(3)
- 用C#开发.NET CF 蓝牙通信模块(1)
- 用C#开发.NET CF 蓝牙通信模块(2)
- C#设计模式编程之抽象工厂模式新解(1)
- [翻译] Effective C++, 3rd Edition, Item 45: 用 member function templates(成员函数模板) 接受 "all compatible types"(“所有兼容类型”)
- C#设计模式编程之抽象工厂模式新解(2)
- 写在开始的话
- 结婚...抗战8周年