All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JRadioButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.AbstractButton
                                   |
                                   +----com.sun.java.swing.JToggleButton
                                           |
                                           +----com.sun.java.swing.JRadioButton

public class JRadioButton
extends JToggleButton
implements Accessible
An implementation of a radio button. Used with ButtonGroup to create a group of buttons in which only one button at a time can be selected. See How to Use Radio Buttons in The Java Tutorial for further documentation.

See Also:
ButtonGroup

Constructor Index

 o JRadioButton()
Creates an initially unselected radio button with no set text.
 o JRadioButton(Icon)
Creates an initially unselected radio button with the specified image but no text.
 o JRadioButton(Icon, boolean)
Creates a radio button with the specified image and selection state, but no text.
 o JRadioButton(String)
Creates an unselected radio button with the specified text.
 o JRadioButton(String, boolean)
Creates a radio button with the specified text and selection state.
 o JRadioButton(String, Icon)
Creates a radio button that has the specified text and image, and that is initially unselected.
 o JRadioButton(String, Icon, boolean)
Creates a radio button that has the specified text, image, and selection state.

Method Index

 o getAccessibleRole()
Get the role of this object.
 o getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.
 o updateUI()
Notification from the UIFactory that the L&F has changed.

Constructors

 o JRadioButton
 public JRadioButton()
Creates an initially unselected radio button with no set text.

 o JRadioButton
 public JRadioButton(Icon icon)
Creates an initially unselected radio button with the specified image but no text.

Parameters:
icon - the image that the button should display
 o JRadioButton
 public JRadioButton(Icon icon,
                     boolean selected)
Creates a radio button with the specified image and selection state, but no text.

Parameters:
icon - the image that the button should display
selected - if true, the button is initially selected; otherwise, the button is initially unselected
 o JRadioButton
 public JRadioButton(String text)
Creates an unselected radio button with the specified text.

Parameters:
text - the string displayed on the radio button
 o JRadioButton
 public JRadioButton(String text,
                     boolean selected)
Creates a radio button with the specified text and selection state.

Parameters:
text - the string displayed on the radio button
selected - if true, the button is initially selected; otherwise, the button is initially unselected
 o JRadioButton
 public JRadioButton(String text,
                     Icon icon)
Creates a radio button that has the specified text and image, and that is initially unselected.

Parameters:
text - the string displayed on the radio button
icon - the image that the button should display
 o JRadioButton
 public JRadioButton(String text,
                     Icon icon,
                     boolean selected)
Creates a radio button that has the specified text, image, and selection state.

Parameters:
text - the string displayed on the radio button
icon - the image that the button should display

Methods

 o updateUI
 public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JToggleButton
See Also:
updateUI
 o getUIClassID
 public String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.

Returns:
String "RadioButtonUI"
Overrides:
getUIClassID in class JToggleButton
See Also:
getUIClassID, getUI
 o getAccessibleRole
 public AccessibleRole getAccessibleRole()
Get the role of this object.

Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class JToggleButton
See Also:
AccessibleRole

All Packages  Class Hierarchy  This Package  Previous  Next  Index