|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.AbstractButton
|
+--javax.swing.JButton
An implementation of a "push" button. See How to Use Buttons, Check Boxes, and Radio Buttons in The Java Tutorial for information and examples of using buttons.
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JButton key assignments.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
| Inner Class Summary | |
protected class |
JButton.AccessibleJButton
This class implements accessibility support for the JButton class. |
| Inner classes inherited from class javax.swing.AbstractButton |
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
| Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JButton()
Creates a button with no set text or icon. |
|
JButton(Action a)
Creates a button where properties are taken from the Action supplied. |
|
JButton(Icon icon)
Creates a button with an icon. |
|
JButton(String text)
Creates a button with text. |
|
JButton(String text,
Icon icon)
Creates a button with initial text and an icon. |
|
| Method Summary | |
protected void |
configurePropertiesFromAction(Action a)
Factory method which sets the AbstractButton's properties according to values from the Action instance. |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this JButton. |
String |
getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component. |
boolean |
isDefaultButton()
Returns whether or not this button is the default button on the RootPane. |
boolean |
isDefaultCapable()
Returns whether or not this button is capable of being the default button on the RootPane. |
protected String |
paramString()
Returns a string representation of this JButton. |
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. |
void |
setDefaultCapable(boolean defaultCapable)
Sets whether or not this button is capable of being the default button on the RootPane. |
void |
updateUI()
Notification from the UIFactory that the L&F has changed. |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public JButton()
public JButton(Icon icon)
icon - the Icon image to display on the buttonpublic JButton(String text)
text - the text of the buttonpublic JButton(Action a)
public JButton(String text,
Icon icon)
text - the text of the button.icon - the Icon image to display on the button| Method Detail |
public void updateUI()
updateUI in class AbstractButtonJComponent.updateUI()public String getUIClassID()
getUIClassID in class JComponentJComponent.getUIClassID(),
UIDefaults.getUI(javax.swing.JComponent)public boolean isDefaultButton()
JRootPane.setDefaultButton(javax.swing.JButton)public boolean isDefaultCapable()
setDefaultCapable(boolean),
isDefaultButton(),
JRootPane.setDefaultButton(javax.swing.JButton)public void setDefaultCapable(boolean defaultCapable)
isDefaultCapable()public void removeNotify()
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.removeNotify in class JComponentjavax.swing.JComponentJComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)protected void configurePropertiesFromAction(Action a)
configurePropertiesFromAction in class AbstractButtona - the Action from which to get the properties, or nullAction,
AbstractButton.setAction(javax.swing.Action)protected String paramString()
null.paramString in class AbstractButtonpublic AccessibleContext getAccessibleContext()
getAccessibleContext in interface AccessiblegetAccessibleContext in class JComponent
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.