GNU Classpath (0.20) | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
JButton
s can display a label,
an Icon
or both.
Nested Class Summary | |
protected class |
|
Nested classes/interfaces inherited from class javax.swing.AbstractButton | |
AbstractButton.AccessibleAbstractButton , AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent | |
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container | |
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component | |
Component.AccessibleAWTComponent , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
| |
Method Summary | |
protected void |
|
AccessibleContext |
|
Object[] |
|
String |
|
boolean | |
boolean | |
protected String |
|
void |
|
void |
|
void |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
public JButton()
Creates a new AbstractButton object. Subclasses should call the following sequence in their constructor in order to initialize the button correctly:super(); init(text, icon);TheAbstractButton.init(String,Icon)
method is not called automatically by this constructor.
- See Also:
AbstractButton.init(String,Icon)
protected void configurePropertiesFromAction(Action a)
Configure various properties of the button by reading properties of anAction
. The mapping of properties is as follows:In addition, this method always sets the button's "enabled" property to the value of the Action's "enabled" property. If the provided Action is
Action keyed property AbstractButton property NAME text SMALL_ICON icon SHORT_DESCRIPTION toolTipText MNEMONIC_KEY mnemonic ACTION_COMMAND_KEY actionCommand null
, the text, icon, and toolTipText properties of the button are set tonull
, and the "enabled" property is set totrue
; the mnemonic and actionCommand properties are unchanged.
- Overrides:
- configurePropertiesFromAction in interface AbstractButton
- Parameters:
a
- An Action to configure the button from
public AccessibleContext getAccessibleContext()
If a component supports the Accessibility API then this method should not returnnull
. Only classes which must extend an accessible class, but must not itself be accessible, may return null.
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface JComponent
- Returns:
- the context associated with this accessible object
public Object[] getSelectedObjects()
Returns an single-element array containing the "text" property of the button if the "selected" property of the button's model istrue
, otherwise returnsnull
.
- Specified by:
- getSelectedObjects in interface ItemSelectable
- Overrides:
- getSelectedObjects in interface AbstractButton
- Returns:
- The button's "selected object" array
public String getUIClassID()
Get the value of the UIClassID property. This property should be a key in theUIDefaults
table managed byUIManager
, the value of which is the name of a class to load for the component'sJComponent.ui
property.
- Overrides:
- getUIClassID in interface JComponent
- Returns:
- A "symbolic" name which will map to a class to use for the component's UI, such as
"ComponentUI"
protected String paramString()
Returns a string, used only for debugging, which identifies or somehow represents this button. The exact value is implementation-defined.
- Overrides:
- paramString in interface AbstractButton
- Returns:
- A string representation of the button
public void removeNotify()
Overrides JComponent.removeNotify to check if this button is currently set as the default button on the RootPane, and if so, sets the RootPane's default button to null to ensure the RootPane doesn't hold onto an invalid button reference.
- Overrides:
- removeNotify in interface JComponent
public void updateUI()
Set the "UI" property to a class constructed, via theUIManager
, from the current look and feel. This should be overridden for each subclass of AbstractButton, to retrieve a suitableButtonUI
look and feel class.
- Overrides:
- updateUI in interface AbstractButton
GNU Classpath (0.20) |