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
2 answers
Initializing JCheckBoxes when they are generated by a Table Model
In Java Swing I have created a JTable which uses a table model class which extends DefaultTableModel. As the values of one row of the table are of boolean type, these are displayed as check-boxes. As I want to add to these check-boxes 'item…

Anto
- 4,265
- 14
- 63
- 113
0
votes
2 answers
Adding JCheckBox to JTable using Netbeans
I have a JTable in my JDialog which I populate myself in another method. Here is my code and I want the second null in my Object array to be a JCheckBox. I have been scowering the internet and saw someone say I need to override a method in the…

ItsRainingHP
- 139
- 1
- 4
- 18
0
votes
1 answer
Jtable false results after remove filtering
I have a Jtable in my gui in which I project some results ! I have also 3 JCheckBoxes that are used as filters ! The problem is that when I check a JCheckBox for first time the results are filtered correctly , but when I uncheck the JCheckBox the…

gimbo
- 67
- 1
- 18
0
votes
3 answers
Make a JCheckBox unable to be checked
I'm a beginner in java and I have a gui in java that has two rows of 3 checkboxes ! I want to enable the second row according to the checkboxes that are check in the first ! For example if I check the first row first checkbox , then the sexond row…

gimbo
- 67
- 1
- 18
0
votes
1 answer
Jcheckbox inside a column in a JTable
I want to create a table where every time a new row is added, a new check box in a certain column will also be added. I've don my research but i still cant find the right answer for my question, and sometimes i find it hard to understand some of the…

harraypotter
- 111
- 2
- 2
- 11
0
votes
2 answers
How to implement checkbox list java
Probably a noob question, but im new to java. I have a need for a checkbox list which I found is not supported in swing, but I found this custom control here
http://www.devx.com/tips/Tip/5342
So I created a class file named CheckBoxList, and copied…

FrostyFire
- 3,212
- 3
- 29
- 53
0
votes
1 answer
Programmatically deselecting a row in JTable
I want to programmatically deselect a row in JTable. Basically I have cehckbix in my jtable and my row needs to be selected or highlited when I click on checkbox. CLicking in any other column should not highlight the row.
I tries…

user3224119
- 3
- 2
0
votes
1 answer
How to use JCheckBox to make JTextField editable and vice versa?
I am writing an application in Java and am using Netbeans IDE. I have set two JCheckBox (chk1 and chk2) and two JTextField (jtextfield1 and jtextfield2). I want that if I check chk1, jtextfield2 will be set to uneditable and if I chk2, jtextfield2…

user3216802
- 9
- 3
0
votes
0 answers
Adding a JPopupMenu to an array of JCheckBoxes
I am trying to add JPopupMenu (on right click) to an array of check boxes and am doing it in below way:
JPanel Pane = new JPanel();
Pane.setLayout(new BoxLayout(Pane, BoxLayout.PAGE_AXIS));
m_popMenu = new JPopupMenu();
JMenuItem item = new…

user3164187
- 1,382
- 3
- 19
- 50
0
votes
2 answers
How to add checkbox to the right side of jButton?
I want to create a button with checkbox in the right side of it.
i tried this but checkbox stays on the center of button on the top of button label text.
Any ideas welkom.
thanks in advance:
public class MainTest extends JPanel {
JButton…

michdraft
- 556
- 3
- 11
- 31
0
votes
2 answers
Adding JCheckBox into JTable
I have a program to display database into a dynamic JTable. Its working fine. Now I want to add 1 more column into the table with CheckBox in each field. What should I do?
Here is my code:
public static DefaultTableModel myTableModel(ResultSet rs)…

RAJIL KV
- 399
- 1
- 7
- 24
0
votes
1 answer
JTextField wont work properly
I'm currently trying to add an event to a JTextField, depending on two checkboxes, but it seems that it's not working properly.
txKids is the JTextField that I want to modify according to the status of those two checkboxes, cbChildrenY and…

Niconoid
- 107
- 2
- 12
0
votes
2 answers
JTable render Boolean as JToggleButton
Hi I am able to render the Boolean column as a JToggleButton but if I keep the button pressed, I am seeing the checkbox instead of the button.
TableColumnModel tcm = smartAlertsTable.getColumnModel();
TableColumn tc = tcm.getColumn( Index of the…

aditya
- 112
- 1
- 10
0
votes
2 answers
Get all selected index of Checkbox
I am a beginner to Java Swing. I have a table with 3 columns. The first column has only check boxes. I wanted to get the index of all the selected items of the check box and store it in an ArrayList. How can I accomplish this?

user3089869
- 209
- 2
- 6
- 14
0
votes
2 answers
JCheckbox only changing his state by controller
Normal JCheckbox react directly on user input and sets or unsets the tick. After this the MouseListener is called. What I want to achieve is that the state of the JCheckbox can only be changed by the controller. What are decent way to achieve…

Pascal Zaugg
- 183
- 2
- 9