Example usage for Java javax.swing AbstractButton fields, constructors, methods, implement or subclass
The text is from its open source code.
String | TEXT_CHANGED_PROPERTY Identifies a change in the button's text. |
String | ICON_CHANGED_PROPERTY Identifies a change to the icon that represents the button. |
void | addActionListener(ActionListener l) Adds an ActionListener to the button. |
void | addChangeListener(ChangeListener l) Adds a ChangeListener to the button. |
void | addItemListener(ItemListener l) Adds an ItemListener to the checkbox . |
void | addMouseListener(MouseListener l) Adds the specified mouse listener to receive mouse events from this component. |
void | addPropertyChangeListener(PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list. |
void | doClick(int pressTime) Programmatically perform a "click". |
void | doClick() Programmatically perform a "click". |
Action | getAction() Returns the currently set Action for this ActionEvent source, or null if no Action is set. |
String | getActionCommand() Returns the action command for this button. |
ActionListener[] | getActionListeners() Returns an array of all the ActionListener s added to this AbstractButton with addActionListener(). |
Color | getBackground() Gets the background color of this component. |
Rectangle | getBounds() Gets the bounds of this component in the form of a Rectangle object. |
ChangeListener[] | getChangeListeners() Returns an array of all the ChangeListener s added to this AbstractButton with addChangeListener(). |
Object | getClientProperty(Object key) Returns the value of the property with the specified key. |
Icon | getDisabledIcon() Returns the icon used by the button when it's disabled. |
Icon | getDisabledSelectedIcon() Returns the icon used by the button when it's disabled and selected. |
int | getDisplayedMnemonicIndex() Returns the character, as an index, that the look and feel should provide decoration for as representing the mnemonic character. |
Color | getForeground() Gets the foreground color of this component. |
int | getHorizontalAlignment() Returns the horizontal alignment of the icon and text. |
int | getHorizontalTextPosition() Returns the horizontal position of the text relative to the icon. |
Icon | getIcon() Returns the default icon. |
int | getIconTextGap() Returns the amount of space between the text and the icon displayed in this button. |
ItemListener[] | getItemListeners() Returns an array of all the ItemListener s added to this AbstractButton with addItemListener(). |
Insets | getMargin() Returns the margin between the button's border and the label. |
int | getMnemonic() Returns the keyboard mnemonic from the current model. |
ButtonModel | getModel() Returns the model that this button represents. |
String | getName() Gets the name of the component. |
Dimension | getPreferredSize() If the preferredSize has been set to a non-null value just returns it. |
Icon | getPressedIcon() Returns the pressed icon for the button. |
Icon | getRolloverIcon() Returns the rollover icon for the button. |
Icon | getRolloverSelectedIcon() Returns the rollover selection icon for the button. |
Icon | getSelectedIcon() Returns the selected icon for the button. |
Dimension | getSize() Returns the size of this component in the form of a Dimension object. |
String | getText() Returns the button's text. |
int | getVerticalAlignment() Returns the vertical alignment of the text and icon. |
int | getVerticalTextPosition() Returns the vertical position of the text relative to the icon. |
boolean | isBorderPainted() Gets the borderPainted property. |
boolean | isContentAreaFilled() Gets the contentAreaFilled property. |
boolean | isEnabled() Determines whether this component is enabled. |
boolean | isFocusPainted() Gets the paintFocus property. |
boolean | isRolloverEnabled() Gets the rolloverEnabled property. |
boolean | isSelected() Returns the state of the button. |
boolean | isShowing() Determines whether this component is showing on screen. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | removeActionListener(ActionListener l) Removes an ActionListener from the button. |
void | removeMouseListener(MouseListener l) Removes the specified mouse listener so that it no longer receives mouse events from this component. |
void | setAction(Action a) Sets the Action . |
void | setActionCommand(String actionCommand) Sets the action command for this button. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setBorderPainted(boolean b) Sets the borderPainted property. |
void | setContentAreaFilled(boolean b) Sets the contentAreaFilled property. |
void | setDisabledIcon(Icon disabledIcon) Sets the disabled icon for the button. |
void | setDisabledSelectedIcon(Icon disabledSelectedIcon) Sets the disabled selection icon for the button. |
void | setDisplayedMnemonicIndex(int index) Provides a hint to the look and feel as to which character in the text should be decorated to represent the mnemonic. |
void | setEnabled(boolean b) Enables (or disables) the button. |
void | setFocusable(boolean focusable) Sets the focusable state of this Component to the specified value. |
void | setFocusPainted(boolean b) Sets the paintFocus property, which must be true for the focus state to be painted. |
void | setForeground(Color fg) Sets the foreground color of this component. |
void | setHideActionText(boolean hideActionText) Sets the hideActionText property, which determines whether the button displays text from the Action . |
void | setHorizontalAlignment(int alignment) Sets the horizontal alignment of the icon and text. |
void | setHorizontalTextPosition(int textPosition) Sets the horizontal position of the text relative to the icon. |
void | setIcon(Icon defaultIcon) Sets the button's default icon. |
void | setIconTextGap(int iconTextGap) If both the icon and text properties are set, this property defines the space between them. |
void | setIgnoreRepaint(boolean ignoreRepaint) Sets whether or not paint messages received from the operating system should be ignored. |
void | setMargin(Insets m) Sets space for margin between the button's border and the label. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setMnemonic(int mnemonic) Sets the keyboard mnemonic on the current model. |
void | setMnemonic(char mnemonic) This method is now obsolete, please use setMnemonic(int) to set the mnemonic for a button. |
void | setMultiClickThreshhold(long threshhold) Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events. |
void | setName(String name) Sets the name of the component to the specified string. |
void | setOpaque(boolean isOpaque) If true the component paints every pixel within its bounds. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setPressedIcon(Icon pressedIcon) Sets the pressed icon for the button. |
void | setRequestFocusEnabled(boolean requestFocusEnabled) Provides a hint as to whether or not this JComponent should get focus. |
void | setRolloverEnabled(boolean b) Sets the rolloverEnabled property, which must be true for rollover effects to occur. |
void | setRolloverIcon(Icon rolloverIcon) Sets the rollover icon for the button. |
void | setSelected(boolean b) Sets the state of the button. |
void | setSelectedIcon(Icon selectedIcon) Sets the selected icon for the button. |
void | setText(String text) Sets the button's text. |
void | setToolTipText(String text) Registers the text to display in a tool tip. |
void | setVerticalAlignment(int alignment) Sets the vertical alignment of the icon and text. |
void | setVerticalTextPosition(int textPosition) Sets the vertical position of the text relative to the icon. |
void | setVisible(boolean aFlag) Makes the component visible or invisible. |