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

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

Introduction

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

The text is from its open source code.

Subclass

javax.swing.JToggleButton has subclasses.
Click this link to see all its subclasses.

Constructor

JToggleButton(Icon icon)
Creates an initially unselected toggle button with the specified image but no text.
JToggleButton(String text)
Creates an unselected toggle button with the specified text.
JToggleButton(Action a)
Creates a toggle button where properties are taken from the Action supplied.
JToggleButton()
Creates an initially unselected toggle button without setting the text or image.
JToggleButton(Icon icon, boolean selected)
Creates a toggle button with the specified image and selection state, but no text.
JToggleButton(String text, boolean selected)
Creates a toggle button with the specified text and selection state.
JToggleButton(String text, Icon icon)
Creates a toggle button that has the specified text and image, and that is initially unselected.
JToggleButton(String text, Icon icon, boolean selected)
Creates a toggle button with the specified text, image, and selection state.

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.
voiddoClick()
Programmatically perform a "click".
ObjectgetClientProperty(Object key)
Returns the value of the property with the specified key.
FontgetFont()
Gets the font of this component.
IcongetIcon()
Returns the default icon.
DimensiongetMaximumSize()
If the maximum size has been set to a non-null value just returns it.
DimensiongetMinimumSize()
If the minimum size has been set to a non-null value just returns it.
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.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
StringgetText()
Returns the button's text.
booleanisEnabled()
Determines whether this component is enabled.
booleanisSelected()
Returns the state of the button.
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to 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.
voidsetCursor(Cursor cursor)
Sets the cursor image to the specified cursor.
voidsetDisabledIcon(Icon disabledIcon)
Sets the disabled icon for the button.
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.
voidsetFont(Font font)
Sets the font for this component.
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.
voidsetMargin(Insets m)
Sets space for margin between the button's border and the label.
voidsetMaximumSize(Dimension maximumSize)
Sets the maximum size of this component to a constant value.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
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.
voidsetRolloverIcon(Icon rolloverIcon)
Sets the rollover icon for the button.
voidsetRolloverSelectedIcon(Icon rolloverSelectedIcon)
Sets the rollover selected icon for the button.
voidsetSelected(boolean b)
Sets the state of the button.
voidsetSelectedIcon(Icon selectedIcon)
Sets the selected icon for the button.
voidsetSize(Dimension d)
Resizes this component so that it has width d.width and height d.height .
voidsetText(String text)
Sets the button's text.
voidsetToolTipText(String text)
Registers the text to display in a tool tip.
voidsetUI(ButtonUI ui)
Sets the L&F object that renders this component.
voidsetVerticalTextPosition(int textPosition)
Sets the vertical position of the text relative to the icon.