JCheckBox Class
Package: javax.swing
The JCheckBox class creates a check box that the user can click (select) to check or clear. Check boxes usually let the user specify a Yes or No setting for an option. Figure 5-3 shows a frame with three check boxes.

Figure 5-3
Constructors
|
Constructor |
Description |
|
|
Creates a new check box that is initially unchecked. |
|
|
Creates a new check box that displays the specified text. |
|
|
Creates a new check box with the specified text. The |
Methods
|
Method |
Description |
|
|
Adds an |
|
|
Adds an |
|
|
Gets the text displayed by the check box |
|
|
Returns |
|
|
Checks the check box if the parameter is |
|
|
Sets the check box text |
|
|
Sets the tooltip text that’s displayed if the user rests the mouse over the check box for ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access