Example usage for Java javax.swing JToggleButton fields, constructors, methods, implement or subclass
The text is from its open source code.
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. |
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 | doClick() Programmatically perform a "click". |
Object | getClientProperty(Object key) Returns the value of the property with the specified key. |
Font | getFont() Gets the font of this component. |
Icon | getIcon() Returns the default icon. |
Dimension | getMaximumSize() If the maximum size has been set to a non- null value just returns it. |
Dimension | getMinimumSize() If the minimum size has been set to a non- null value just returns it. |
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. |
Dimension | getSize() Returns the size of this component in the form of a Dimension object. |
String | getText() Returns the button's text. |
boolean | isEnabled() Determines whether this component is enabled. |
boolean | isSelected() Returns the state of the button. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to 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 | setCursor(Cursor cursor) Sets the cursor image to the specified cursor. |
void | setDisabledIcon(Icon disabledIcon) Sets the disabled icon for the button. |
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 | setFont(Font font) Sets the font for this component. |
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 | setMargin(Insets m) Sets space for margin between the button's border and the label. |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
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 | setRolloverIcon(Icon rolloverIcon) Sets the rollover icon for the button. |
void | setRolloverSelectedIcon(Icon rolloverSelectedIcon) Sets the rollover selected 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 | setSize(Dimension d) Resizes this component so that it has width d.width and height d.height . |
void | setText(String text) Sets the button's text. |
void | setToolTipText(String text) Registers the text to display in a tool tip. |
void | setUI(ButtonUI ui) Sets the L&F object that renders this component. |
void | setVerticalTextPosition(int textPosition) Sets the vertical position of the text relative to the icon. |