JRadioButtonMenuItem
2017-04-16 17:17
381 查看
An implementation of a radio button menu item. A JRadioButtonMenuItem is a menu item that is part of a group of menu items in which only one item in the group can be selected. The selected item displays its selected state. Selecting it causes any other selected item to switch to the unselected state. To control the selected state of a group of radio button menu items, use a ButtonGroup object.
单选按钮菜单项的实现。 JRadioButtonMenuItem是一个菜单项,它是一组菜单项的一部分,其中只能选择一个组中的一个项。 所选项显示其所选状态。 选择它将导致任何其他所选项目切换到未选择的状态。 要控制一组单选按钮菜单项的选定状态,请使用ButtonGroup对象。
使用相同的ButtonGroup对象创建一组按钮意味着打开“其中一个”按钮会关闭组中的所有其他按钮。
ButtonGroup可以与继承自AbstractButton的任何一组对象一起使用。 通常,按钮组包含JRadioButton,JRadioButtonMenuItem或JToggleButton的实例。 将JButton或JMenuItem的实例放在按钮组中是没有意义的,因为JButton和JMenuItem不实现所选状态。
初始时,组中的所有按钮都被取消选择
单选按钮菜单项的实现。 JRadioButtonMenuItem是一个菜单项,它是一组菜单项的一部分,其中只能选择一个组中的一个项。 所选项显示其所选状态。 选择它将导致任何其他所选项目切换到未选择的状态。 要控制一组单选按钮菜单项的选定状态,请使用ButtonGroup对象。
使用相同的ButtonGroup对象创建一组按钮意味着打开“其中一个”按钮会关闭组中的所有其他按钮。
ButtonGroup可以与继承自AbstractButton的任何一组对象一起使用。 通常,按钮组包含JRadioButton,JRadioButtonMenuItem或JToggleButton的实例。 将JButton或JMenuItem的实例放在按钮组中是没有意义的,因为JButton和JMenuItem不实现所选状态。
初始时,组中的所有按钮都被取消选择
JRadioButtonMenuItem jRMItemEasy = new JRadioButtonMenuItem("简单:单一花色"); JRadioButtonMenuItem jRMItemNormal = new JRadioButtonMenuItem("中级:双花色"); JRadioButtonMenuItem jRMItemHard = new JRadioButtonMenuItem("高级:四花色");; ButtonGroup group = new ButtonGroup(); group.add(jRMItemEasy); group.add(jRMItemNormal); group.add(jRMItemHard);
相关文章推荐
- 关于JRadioButtonMenuItem的使用
- uwp 如何使用c#生成带MenuFlyoutItem的AppBarButton
- 【Cocos2D-X 游戏引擎】初窥门径(16)几种常用的 CCMenuItem、自定义Button
- Windows菜单函数 - CheckMenuRadioItem
- 几种常用的 CCMenuItem、自定义Button
- Qt, how to add radio button or checkbox in menu
- Add Ribbon button and menu item in Sharepoint 2010
- Creating a radio button item renderer on a Spark List control in Flex 4
- ListView中加入RadioButton 当点击ListView的item时,选中里面的RadioButton
- Win32汇编--菜单进阶之菜单的单选与多选(CheckMenuItem&CheckMenuRadioItem)
- ListView中加入RadioButton 当点击ListView的item时,选中里面的RadioButton
- android 语言国际化 + 点击按钮出现menu + 点击menu出现dialog对话框 + radiobutton 点击事件
- 文本转载【Cocos2D-X 】初窥门径(16)几种常用的 CCMenuItem、自定义Button
- Using commands with ApplicationBarMenuItem and ApplicationBarButton in Windows Phone 7
- GTK Gossip: GtkCheckMenuItem、GtkRadioMenuItem 與 GtkTearoffMenuItem
- GetCheckedRadioButton
- label for="radiobutton" fieldset与div区别
- android ListView Item和CheckBox、Button点击事件冲突的问题
- UINavigationItem如何设置backBarButtonItem
- ios 对于修改navigationItem的颜色和系统自带的navigationItem的rightBarButtonItem的颜色的问题