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

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

Introduction

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

The text is from its open source code.

Subclass

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

Constructor

JCheckBox()
Creates an initially unselected check box button with no text, no icon.
JCheckBox(Icon icon)
Creates an initially unselected check box with an icon.
JCheckBox(String text)
Creates an initially unselected check box with text.
JCheckBox(Action a)
Creates a check box where properties are taken from the Action supplied.
JCheckBox(Icon icon, boolean selected)
Creates a check box with an icon and specifies whether or not it is initially selected.
JCheckBox(String text, boolean selected)
Creates a check box with text and specifies whether or not it is initially selected.
JCheckBox(String text, Icon icon)
Creates an initially unselected check box with the specified text and icon.
JCheckBox(String text, Icon icon, boolean selected)
Creates a check box with text and icon, and specifies whether or not it is initially selected.

Method

voidaddActionListener(ActionListener l)
Adds an ActionListener to the button.
voidaddChangeListener(ChangeListener l)
Adds a ChangeListener to the button.
voidaddComponentListener(ComponentListener l)
Adds the specified component listener to receive component events from this component.
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".
AccessibleContextgetAccessibleContext()
Gets the AccessibleContext associated with this JCheckBox.
StringgetActionCommand()
Returns the action command for this button.
ObjectgetClientProperty(Object key)
Returns the value of the property with the specified key.
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.
Object[]getSelectedObjects()
Returns an array (length 1) containing the label or null if the button is not selected.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
StringgetText()
Returns the button's text.
ButtonUIgetUI()
Returns the L&F object that renders this component.
intgetX()
Returns the current x coordinate of the component's origin.
intgetY()
Returns the current y coordinate of the component's origin.
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.
voidremoveActionListener(ActionListener l)
Removes an ActionListener from the button.
voidrequestFocus()
Requests that this Component gets the input focus.
voidsetAction(Action a)
Sets the Action.
voidsetActionCommand(String actionCommand)
Sets the action command for this button.
voidsetAlignmentX(float alignmentX)
Sets the horizontal alignment.
voidsetAlignmentY(float alignmentY)
Sets the vertical alignment.
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.
voidsetBorderPaintedFlat(boolean b)
Sets the borderPaintedFlat property, which gives a hint to the look and feel as to the appearance of the check box border.
voidsetBounds(Rectangle r)
Moves and resizes this component to conform to the new bounding rectangle r .
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
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.
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.
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.
voidsetMnemonic(int mnemonic)
Sets the keyboard mnemonic on the current model.
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.
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.
voidsetVisible(boolean aFlag)
Makes the component visible or invisible.