JCheckBox is the Java Swing implementation of a check box, an item that can be selected or deselected, and which displays its state to the user.
Questions tagged [jcheckbox]
613 questions
0
votes
0 answers
How can I use WindowBuilder to add checkbox in JTable?
I have a JTable populated from database. My need is to add a column in the table with a checkbox for each row. User should be able to select any number of rows by checking the check boxes. Also a checkbox should be present on the column header to…

Tan90
- 29
- 4
0
votes
2 answers
JCheckBox State Remain Consistent Among Classes
I have a help pane which appears at the start of a program, but can be turned off. If the user wants it to return, there is an option in the menu bar to reactivate it. However, when they choose to show it from the help menu, it automatically…

comfycozy
- 141
- 2
- 3
- 14
0
votes
1 answer
JCheckBox deselects automatically
When I select the JCheckBox, it automatically deselects...
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Math extends JFrame
{
private JPanel panel2 = new JPanel();
private JCheckBox cb = new…
user6566753
0
votes
1 answer
Enable only 1 of 2 Swing checkboxes
I have 2 checkboxes (A & B) declared with JCheckBox.
Is there any way to disable a checkbox B if checkbox A is checked and vice versa? If I check checkbox B, checkbox A should be disabled using AWT Swing.

chand
- 27
- 5
0
votes
1 answer
Trying to add item listener to a JCheckBox object
I am trying add an item listener to a checkbox to see if its been checked, and if it is, to be added to a list of SQL table names to be selected. Inversely, if it is not selected then remove it from the list. I cannot add a listener though to any…

JJ Jansen
- 1
- 3
0
votes
2 answers
Swing JCheckBox - set string according to ticked-unticked
I have created a window to appear when my program loads, and give the user the option to make it not appear through a checkbox. I also have the .properties file set and know how to update the fields etc.
What I do not know is what event to use, so…

Ema Black
- 63
- 1
- 12
0
votes
0 answers
NullPointerException while referencing checkboxes in another class?
Why's there a null pointer exception for referencing the checkboxes in other classes? Is it because I have to make the CheckBox graphically visible in order to make them not null?
Here's the error:
Exception in thread "AWT-EventQueue-0"…

ProgrammingFreak
- 498
- 3
- 13
0
votes
0 answers
How to individually set disabled Back- and Forecolor for elements
i am working on a project where every Element on Frame has to be ReadOnly, but there is a SearchMode where the Object should be not ReadOnly. So it has to switch between those two modes
my Problem now is that the JTextField has a Property…

Kevin Barz
- 31
- 2
- 9
0
votes
0 answers
Java Checkbox List Selection Listener
I have code for making a checkbox list. However, if I click anywhere on a row the checkbox selection changes. I want this to only happen when the checkbox itself is clicked. How do I correct this listener to be "accurate"?
Here is a SSCCE:
import…

BullyWiiPlaza
- 17,329
- 10
- 113
- 185
0
votes
1 answer
Error while retrieving data from database to JTable which has JCheckbox in JTable using TableModelListener
My JTable has a column having JCheckBox for maintaining status. When I don't implement TableModelListener and run the program, the data gets displayed in JTable. But when I run the code with TableModelListener implemented I get error.…

Jikesh Prajapati
- 13
- 1
- 7
0
votes
1 answer
Creating JComboBox with checkboxes
TL:DR I want to create a JComboBox which has JCheckboxes instead of JLabels everywhere but in the main label - in this place I want to keep string representing values of all checked boxes. I managed to make it work, but I have some troubles with…
0
votes
0 answers
customized java swing Jtree layout(checkbox)
I want to created tree on java swing, i use JTree component,the thing I want to do is created with checkbox,i seen many ways to do that,but i want let checkboxes beside tree,not in the tree.Is there anybody can help me? The picture below is the…

Ives
- 505
- 1
- 4
- 14
0
votes
1 answer
"AWT-EventQueue-0" ClassCastException: JPanel cannot be cast MyJTestPanel
Program not close but when i click my checkbox i get an exception like this;
my class is here and it is extends from JPanel,my class is here and it is extends from JPanel,my class is here and it is extends from JPanel,my class is here and it is…

enes
- 95
- 2
- 9
0
votes
2 answers
Updating checkboxes in Jtable goes into recursion, causes stack overflow error
I have a Jtable set up in a tabbed pane that is filled with an id and checkboxes. The table looks something along the lines of this, where . are the checkboxes.
| VAR1 |
ID | ALL | subVar1 | subVar2…

Phreakradio
- 176
- 1
- 18
0
votes
0 answers
How can i add itemlistener to jcheckbox i added runtime?
I have records in database that I added on my program within jcheckbox but my problem here is that i'm not really sure how to add itemListener to those jcheckbox. I created an array of jcheckbox. What exactly i want to do is once that checkbox was…

Laxus Dreyar
- 1
- 1