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
3
votes
1 answer
JCheckBox Behavior in JTable
I followed the directions somewhere online to insert checkboxes in a JTable. Here is my code to do so:
protected class JTableCellRenderer implements TableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable…

BJ Dela Cruz
- 5,194
- 13
- 51
- 84
3
votes
2 answers
Creating a Button Group Allowing N checked boxes
I am programming in Java, using Swing.
I am currently working with an application which allows the user to display 2 or less hobbies. The list of hobbies is finite. I would like to provide a user with a list of checkboxes to select these items…

Kurisu
- 812
- 10
- 18
3
votes
2 answers
How to increase size of JRadioButtons & JCheckBoxes?
I have a checklist with radio buttons and check boxes, I want to make the circles and boxes little bigger than their default size.

razshan
- 1,128
- 12
- 41
- 59
3
votes
1 answer
Margin to JCheckBox in a JList component
I have a JList component which has JCheckBox renderer as each item.
I want to add margin to the checkBox so that it does not stick to the left side.
I tried
checkBox.setMargin(new Insets(0, 10, 0, 0)); //left side spacing
and also…

user1184100
- 6,742
- 29
- 80
- 121
3
votes
1 answer
Swing JTree with Checkbox and JFileChooser
By using JFileChooser I am able to select file and folders getting JList with File Objects and I am showing it with checkbox. Now my requirement is like I want to show the selected file and folder in tree structure with checkbox and the checkbox…

anand
- 31
- 2
3
votes
4 answers
How to disable Checkbox depending on another Checkbox?
On Java, is there any way to disable a checkbox (call it B), if checkbox A is checked.
When I say disable, the user can't check it off..Its setEditable(false) or something.

razshan
- 1,128
- 12
- 41
- 59
3
votes
5 answers
How to use JCheckBoxes selection for use?
I have a checkbox on a JFrame. When I check it, I want to display on the command window that it has been selected. Below is the code i am working with. It compiles and executes without errors, but I don't get the "one has been selected" on the…

razshan
- 1,128
- 12
- 41
- 59
3
votes
4 answers
Is there a way to customise Java's setEnabled(false)?
Let's say you have a JCheckBox you want to use as an on/off indicator. You use setEnabled(false) to disable mouse clicks on the JCheckBox. But setEnabled(false) also grays out the checkBox and the checkBox's text. Is there a way to customise…

Arvanem
- 1,043
- 12
- 22
3
votes
2 answers
JCheckBox' value resets / doesn't change
I have several components, all inheriting JCheckBox without overwriting anything from it, stored in a vector, which is then traversed and each of the components is added to a dialog
CreateLists(); // initialises the checkbox vector
for(int i = 0; i…

Thomas
- 31
- 2
3
votes
1 answer
Change JCheckBox/JRadioButton selection color
Is there a way to change the selection color of a checkbox/radiobutton?

Vasyl
- 1,393
- 15
- 26
3
votes
3 answers
Create a combobox with multiple checkbox
I have read the doc and tutorial, and searchd here, to no avail.
Oracle tutorial: how to use custom render for ComboBox
Another question similar with a somehow vague answer
And I see it important because many people asked about it but no one can…

WesternGun
- 11,303
- 6
- 88
- 157
3
votes
3 answers
Change JCheckBox 'ticked' color
How do I change or modify the color of the JCheckBox symbol (not the text property). I'm testing UIManager.put("CheckBox.selected", Color.RED) without success.
Can someone help?

BicaBicudo
- 307
- 1
- 8
- 20
3
votes
2 answers
How to get boolean of JCheckBoxMenuItem?
I have this JCheckBoxMenuItem as a field:
private JCheckBoxMenuItem chckbxmntmDisableSending = new JCheckBoxMenuItem("Disable Sending");
I need to find out whether it is checked or not some time later, when doing something else (pressing the send…

ifly6
- 5,003
- 2
- 24
- 47
3
votes
1 answer
Set JTable Cell Disable or Enable based on condition?
I have a JTable. It has four columns; the last column is checkbox column. I want to make the checkbox enable or disable, based on condition.
Consider that the last column value (check box value) is true, then user is not allowed to unselect the…

Thirunavukkarasu
- 208
- 6
- 26
3
votes
2 answers
JTable set disabled checkbox look for uneditable cell
I have JTable with a boolean values column. Depending on the state stored in model I make some or all of them uneditable (model's isCellEditable() returns false). However this does not make the JTable boolean renderer to render the checkboxes as…

ps-aux
- 11,627
- 25
- 81
- 128