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
4
votes
1 answer
Checkbox in header of JTable renders differently with Nimbus L&F
I have Checkbox in JTable Header, I am using Nimbus L&F and customize the header background but the background of the checkbox takes the default grey background not the customize one as others column do.
Following is the CheckboxRenderer…

rcnpl
- 111
- 1
- 2
- 9
4
votes
3 answers
How to reduce the space between the 3 swing checkboxes?
I want to reduce the size between the components with in the Formatting group (left side on the image). How to do this?
JPanel formattingGroup = createGroupWithName("Formatting");
formattingGroup.setMinimumSize(new Dimension(250, 20));
…

Aravind Yarram
- 78,777
- 46
- 231
- 327
4
votes
3 answers
How can I enable/disable my JTextField depending of the state of a JCheckBox?
I have a Java check box next to a text field.
When the check box gets selected, I want the text box to be enabled and when it isn't, I don't want it to be selected. I tried an if statement with the isSelected() method, but it didn't do…

Jeff
- 95
- 1
- 1
- 3
4
votes
2 answers
Notification when a checkbox in a JTable is checked
I've searched for this for quite a while and haven't found a clear example anywhere. I'm a Java newbee using NetBeans. I have a boolean value in the first column of a JTable (called "Enabled") and I have some plugin code that I need to call to see…

Harry Strand
- 43
- 1
- 3
4
votes
1 answer
Change the location of the accessory component in a filechooser
I have a problem in changing the location of the accessory component in a filechooser.
I customized a save file dialog by putting a check box in the accessory component of the file chooser. But the position of the check box is not good, it is really…

Anping Wang
- 43
- 4
4
votes
2 answers
JTable - Checkbox add action listener
I've created a simple JTable with check box like below:
DefaultTableModel model = new DefaultTableModel();
jTable1.setModel(model);
model.addColumn("No:", no1);
model.addColumn("Remark", remark1);
model.addColumn("Color",…

chinna_82
- 6,353
- 17
- 79
- 134
4
votes
3 answers
Make a JCheckBox in a JTable editable
I need some help with my JTable. I am writing a program, wich extracts data from a database into a JTable. The first column should be a editable JCheckBox so I am able to work with the checked (true or false) rows and the data.
I am using a…

Gerret
- 2,948
- 4
- 18
- 28
4
votes
3 answers
How to Check(Marked as checked) buttons in a program(or a checkbox) from just one Button?
Here is my question.Lets say that somebody made a checkbox in java and he is using it in a GUI interface so that the user can select a variety of options.Then the programmer wants to create a button inside the checkbox so that when the user checks…

Bestial Wraith
- 51
- 2
- 5
4
votes
2 answers
Get Selected Rows in JTable using AbstractTableModel
I have a JTable using AbstractTableModel where I have a JCheckBox in the first column for selecting rows. Now, I need to get the selected rows from the table which are checked. Right now, I am sequentially traversing from first row to the last row…

Amarnath
- 8,736
- 10
- 54
- 81
4
votes
2 answers
Getting JCheckBox selected box value
I want to ask is there a way to get information from JCheckBox without actionListener. In my code I scan a file of strings and each line has data which, if selected, should be added to an array in my program. Problem is that i will never know how…

Marius Katinas
- 470
- 1
- 5
- 13
4
votes
2 answers
how to add checkbox and combobox in table cell?
I am creating one form which contain table and some buttons.
A picture is worth a thousand words:
How can I get the checkbox and comboboxes into the table?
I am using NetBeans. I tried using drag and drop but didn't work.
Here is my form code. …

Sandip Armal Patil
- 6,241
- 21
- 93
- 160
4
votes
2 answers
Align icon and JCheckbox in JPopupmenu
I have a Problem with some icons and check-boxes in a JPopupMenu. The Check-boxes and Icons are not aligned
The Items are created like:
JMenuItem deleteAttributeMenuItem = new JMenuItem(locale.getString("TREE_AttrDelete"), iconDelete);
JMenuItem…

Andreas Freitag
- 357
- 1
- 7
- 20
3
votes
1 answer
Java- Reading whether a checkbox is checked or not
My program compiles and runs, but here is my problem. I have a checkbox set up for each item, but I only need it to total the items that are checked and not all of the items. Instead its totalling all items regardless of whether or not they are…

Diallo Dickerson
- 207
- 2
- 7
- 9
3
votes
3 answers
I have an ArrayList that i want to convert to an ArrayList
I have an ArrayList that i want to convert to an ArrayList
First I do like this. I get all my titles from a file and put them into a new ArrayList. Afterwords I make a new JCheckBox Array that contains all the Strings from the…

Strammefar
- 57
- 4
3
votes
1 answer
Background Colour of JCheckBox
Is there any way to change the background colour of a JCheckBox ? I mean the colour inside the little square, not everything around it which is what setBackground does.
Thanks.

pgpv
- 335
- 2
- 10