Java javax.swing AbstractButton fields, constructors, methods, implement or subclass

Example usage for Java javax.swing AbstractButton fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing AbstractButton.

The text is from its open source code.

Field

StringTEXT_CHANGED_PROPERTY
Identifies a change in the button's text.
StringICON_CHANGED_PROPERTY
Identifies a change to the icon that represents the button.

Method

voidaddActionListener(ActionListener l)
Adds an ActionListener to the button.
voidaddChangeListener(ChangeListener l)
Adds a ChangeListener to the button.
voidaddItemListener(ItemListener l)
Adds an ItemListener to the checkbox.
voidaddMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.
voidaddPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
voiddoClick(int pressTime)
Programmatically perform a "click".
voiddoClick()
Programmatically perform a "click".
ActiongetAction()
Returns the currently set Action for this ActionEvent source, or null if no Action is set.
StringgetActionCommand()
Returns the action command for this button.
ActionListener[]getActionListeners()
Returns an array of all the ActionListeners added to this AbstractButton with addActionListener().
ColorgetBackground()
Gets the background color of this component.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
ChangeListener[]getChangeListeners()
Returns an array of all the ChangeListeners added to this AbstractButton with addChangeListener().
ObjectgetClientProperty(Object key)
Returns the value of the property with the specified key.
IcongetDisabledIcon()
Returns the icon used by the button when it's disabled.
IcongetDisabledSelectedIcon()
Returns the icon used by the button when it's disabled and selected.
intgetDisplayedMnemonicIndex()
Returns the character, as an index, that the look and feel should provide decoration for as representing the mnemonic character.
ColorgetForeground()
Gets the foreground color of this component.
intgetHorizontalAlignment()
Returns the horizontal alignment of the icon and text.
intgetHorizontalTextPosition()
Returns the horizontal position of the text relative to the icon.
IcongetIcon()
Returns the default icon.
intgetIconTextGap()
Returns the amount of space between the text and the icon displayed in this button.
ItemListener[]getItemListeners()
Returns an array of all the ItemListeners added to this AbstractButton with addItemListener().
InsetsgetMargin()
Returns the margin between the button's border and the label.
intgetMnemonic()
Returns the keyboard mnemonic from the current model.
ButtonModelgetModel()
Returns the model that this button represents.
StringgetName()
Gets the name of the component.
DimensiongetPreferredSize()
If the preferredSize has been set to a non-null value just returns it.
IcongetPressedIcon()
Returns the pressed icon for the button.
IcongetRolloverIcon()
Returns the rollover icon for the button.
IcongetRolloverSelectedIcon()
Returns the rollover selection icon for the button.
IcongetSelectedIcon()
Returns the selected icon for the button.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
StringgetText()
Returns the button's text.
intgetVerticalAlignment()
Returns the vertical alignment of the text and icon.
intgetVerticalTextPosition()
Returns the vertical position of the text relative to the icon.
booleanisBorderPainted()
Gets the borderPainted property.
booleanisContentAreaFilled()
Gets the contentAreaFilled property.
booleanisEnabled()
Determines whether this component is enabled.
booleanisFocusPainted()
Gets the paintFocus property.
booleanisRolloverEnabled()
Gets the rolloverEnabled property.
booleanisSelected()
Returns the state of the button.
booleanisShowing()
Determines whether this component is showing on screen.
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to this component.
voidremoveActionListener(ActionListener l)
Removes an ActionListener from the button.
voidremoveMouseListener(MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component.
voidsetAction(Action a)
Sets the Action.
voidsetActionCommand(String actionCommand)
Sets the action command for this button.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetBorderPainted(boolean b)
Sets the borderPainted property.
voidsetContentAreaFilled(boolean b)
Sets the contentAreaFilled property.
voidsetDisabledIcon(Icon disabledIcon)
Sets the disabled icon for the button.
voidsetDisabledSelectedIcon(Icon disabledSelectedIcon)
Sets the disabled selection icon for the button.
voidsetDisplayedMnemonicIndex(int index)
Provides a hint to the look and feel as to which character in the text should be decorated to represent the mnemonic.
voidsetEnabled(boolean b)
Enables (or disables) the button.
voidsetFocusable(boolean focusable)
Sets the focusable state of this Component to the specified value.
voidsetFocusPainted(boolean b)
Sets the paintFocus property, which must be true for the focus state to be painted.
voidsetForeground(Color fg)
Sets the foreground color of this component.
voidsetHideActionText(boolean hideActionText)
Sets the hideActionText property, which determines whether the button displays text from the Action.
voidsetHorizontalAlignment(int alignment)
Sets the horizontal alignment of the icon and text.
voidsetHorizontalTextPosition(int textPosition)
Sets the horizontal position of the text relative to the icon.
voidsetIcon(Icon defaultIcon)
Sets the button's default icon.
voidsetIconTextGap(int iconTextGap)
If both the icon and text properties are set, this property defines the space between them.
voidsetIgnoreRepaint(boolean ignoreRepaint)
Sets whether or not paint messages received from the operating system should be ignored.
voidsetMargin(Insets m)
Sets space for margin between the button's border and the label.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetMnemonic(int mnemonic)
Sets the keyboard mnemonic on the current model.
voidsetMnemonic(char mnemonic)
This method is now obsolete, please use setMnemonic(int) to set the mnemonic for a button.
voidsetMultiClickThreshhold(long threshhold)
Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetPressedIcon(Icon pressedIcon)
Sets the pressed icon for the button.
voidsetRequestFocusEnabled(boolean requestFocusEnabled)
Provides a hint as to whether or not this JComponent should get focus.
voidsetRolloverEnabled(boolean b)
Sets the rolloverEnabled property, which must be true for rollover effects to occur.
voidsetRolloverIcon(Icon rolloverIcon)
Sets the rollover icon for the button.
voidsetSelected(boolean b)
Sets the state of the button.
voidsetSelectedIcon(Icon selectedIcon)
Sets the selected icon for the button.
voidsetText(String text)
Sets the button's text.
voidsetToolTipText(String text)
Registers the text to display in a tool tip.
voidsetVerticalAlignment(int alignment)
Sets the vertical alignment of the icon and text.
voidsetVerticalTextPosition(int textPosition)
Sets the vertical position of the text relative to the icon.
voidsetVisible(boolean aFlag)
Makes the component visible or invisible.