All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JToggleButton

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

public class JToggleButton
extends AbstractButton
implements Accessible
An implementation of a two-state button. The JRadioButton and JCheckbox classes are subclasses of this class.

See Also:
JRadioButton, JCheckbox

Constructor Index

 o JToggleButton()
Creates an initially unselected toggle button without setting the text or image.
 o JToggleButton(Icon)
Creates an initially unselected toggle button with the specified image but no text.
 o JToggleButton(Icon, boolean)
Creates a toggle button with the specified image and selection state, but no text.
 o JToggleButton(String)
Creates an unselected toggle button with the specified text.
 o JToggleButton(String, boolean)
Creates a toggle button with the specified text and selection state.
 o JToggleButton(String, Icon)
Creates a toggle button that has the specified text and image, and that is initially unselected.
 o JToggleButton(String, Icon, boolean)
Creates a toggle button with the specified text, image, and selection state.

Method Index

 o getAccessibleRole()
Get the role of this object.
 o getAccessibleStateSet()
Get the accessible state set 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 JToggleButton
 public JToggleButton()
Creates an initially unselected toggle button without setting the text or image.

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

Parameters:
icon - the image that the button should display
 o JToggleButton
 public JToggleButton(Icon icon,
                      boolean selected)
Creates a toggle 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 JToggleButton
 public JToggleButton(String text)
Creates an unselected toggle button with the specified text.

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

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

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

Parameters:
text - the text of the toggle button.
selected - if true, the button is initially selected; otherwise, the button is initially unselected

Methods

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

Overrides:
updateUI in class AbstractButton
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 "ToggleButtonUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o getAccessibleStateSet
 public AccessibleStateSet getAccessibleStateSet()
Get the accessible state set of this object.

Returns:
an instance of AccessibleState containing the current state of the object
Overrides:
getAccessibleStateSet in class AbstractButton
 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 JComponent
See Also:
AccessibleRole

All Packages  Class Hierarchy  This Package  Previous  Next  Index