java.lang.Object | +--java.awt.Component | +--java.awt.Button
Unsafe:
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, bufferStrategy, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, focusTraversalKeys, font, foreground, graphicsConfig, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, ignoreRepaint, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, mouseWheelListener, mouseWheelListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowFocusListenerK, windowListenerK, windowStateListenerK, x, y
Button()
void
addActionListener(ActionListener l)
AccessibleContext
getAccessibleContext()
AccessibleContext associated with
this Button.
String
getActionCommand()
ActionListener[]
getActionListeners()
EventListener[]
getListeners(Class listenerType)
FooListeners
upon this Button.
private static void
initIDs()
protected void
processActionEvent(ActionEvent e)
ActionListener objects.
private void
readObject(ObjectInputStream s)
ObjectInputStream and if
it isn't null adds a listener to
receive action events fired by the button.
void
removeActionListener(ActionListener l)
void
setActionCommand(String command)
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, adjustListeningChildrenOnParent, applyComponentOrientation, areFocusTraversalKeysSet, areInputMethodsEnabled, autoProcessMouseWheel, autoTransferFocus, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, clearCurrentFocusCycleRootOnHide, clearMostRecentFocusOwnerOnHide, coalesceEvents, contains, contains, containsFocus, countHierarchyMembers, createBufferStrategy, createBufferStrategy, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, dispatchMouseWheelToAncestor, doLayout, enable, enable, enableEvents, enableInputMethods, eventTypeEnabled, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackBuffer, getBackground, getBounds, getBounds, getBufferStrategy, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys_NoIDCheck, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initializeFocusTraversalKeys, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusTraversableOverridden, isFontSet, isForegroundSet, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, iterate, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, nextFocusHelper, numListening, paint, paintAll, paintHeavyweightComponents, postEvent, postsOldMouseEvents, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusHelper, requestFocusInWindow, requestFocusInWindow, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys_NoIDCheck, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setGCFromPeer, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocus, transferFocusBackward, transferFocusUpCycle, update, updateCursorImmediately, validate
String label
String actionCommand
transient ActionListener actionListener
private static final String base
private static int nameCounter
private static final long serialVersionUID
private int buttonSerializedDataVersion
public Button() throws HeadlessException
java.awt.GraphicsEnvironment#isHeadlesspublic Button(String label) throws HeadlessException
label - A string label for the button.java.awt.GraphicsEnvironment#isHeadlessprivate static void initIDs()
String constructComponentName()
constructComponentName in class Componentpublic void addNotify()
java.awt.Toolkit#createButton(java.awt.Button),
java.awt.Component#getToolkit()public String getLabel()
null
if the button has no label.java.awt.Button#setLabelpublic void setLabel(String label)
label - the new label, or null
if the button has no label.java.awt.Button#getLabelpublic void setActionCommand(String command)
command - A string used to set the button's
action command.
If the string is null then the action command
is set to match the label of the button.java.awt.event.ActionEventpublic String getActionCommand()
null (default) then this method
returns the label of the button.
public void addActionListener(ActionListener l)
l - the action listenerremoveActionListener(java.awt.event.ActionListener),
getActionListeners(),
java.awt.event.ActionListenerpublic void removeActionListener(ActionListener l)
l - the action listeneraddActionListener(java.awt.event.ActionListener),
getActionListeners(),
java.awt.event.ActionListenerpublic ActionListener[] getActionListeners()
ActionListeners
or an empty array if no action
listeners are currently registeredaddActionListener(java.awt.event.ActionListener),
removeActionListener(java.awt.event.ActionListener),
java.awt.event.ActionListenerpublic EventListener[] getListeners(Class listenerType)
FooListeners
upon this Button.
FooListeners are registered using the
addFooListener method.
You can specify the listenerType argument
with a class literal, such as
FooListener.class.
For example, you can query a
Button b
for its action listeners with the following code:
ActionListener[] als = (ActionListener[])(b.getListeners(ActionListener.class));If no such listeners exist, this method returns an empty array.
getListeners in class ComponentlistenerType - the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListeners on this button,
or an empty array if no such
listeners have been addedgetActionListeners()boolean eventEnabled(AWTEvent e)
eventEnabled in class Componentprotected void processEvent(AWTEvent e)
ActionEvent, this method invokes
the processActionEvent method. Otherwise,
it invokes processEvent on the superclass.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
processEvent in class Componente - the eventjava.awt.event.ActionEvent,
java.awt.Button#processActionEventprotected void processActionEvent(ActionEvent e)
ActionListener objects.
This method is not called unless action events are enabled for this button. Action events are enabled when one of the following occurs:
ActionListener object is registered
via addActionListener.
enableEvents.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
e - the action eventjava.awt.event.ActionListener,
java.awt.Button#addActionListener,
java.awt.Component#enableEventsprotected String paramString()
Button.
This method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null.
paramString in class Componentprivate void writeObject(ObjectOutputStream s) throws IOException
ActionListeners
as optional data. The non-serializable
ActionListeners are detected and
no attempt is made to serialize them.
s - the ObjectOutputStream to write
IOExceptionAWTEventMulticaster.save(ObjectOutputStream, String, EventListener),
java.awt.Component.actionListenerK,
readObject(java.io.ObjectInputStream)private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException
ObjectInputStream and if
it isn't null adds a listener to
receive action events fired by the button.
Unrecognized keys or values will be ignored.
s - the ObjectInputStream to read
ClassNotFoundException
IOException
HeadlessExceptionremoveActionListener(),
addActionListener(),
java.awt.GraphicsEnvironment#isHeadless,
writeObject(java.io.ObjectOutputStream)public AccessibleContext getAccessibleContext()
AccessibleContext associated with
this Button. For buttons, the
AccessibleContext takes the form of an
AccessibleAWTButton.
A new AccessibleAWTButton instance is
created if necessary.
getAccessibleContext in interface AccessiblegetAccessibleContext in class ComponentAccessibleAWTButton that serves as the
AccessibleContext of this Button