Questions tagged [jcheckbox]

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.

613 questions
0
votes
1 answer

jcheckbox in jtable is doing nothing on clicking it, please help needfull

My table model is as follows. The first coloumn of my table is checkbox. I am able to put checkbox in jtable but when I cliked on that checkbox it does nothing. I used the DefaultTableCellRenderer to put checkbox in my table. public class…
0
votes
3 answers

Limit the number of check boxes selected

I am writing a Java App that has multiple items available to test. However -- due to HW limitations, I can only test 4 devices in parallel. I was wondering -- in genera -- how can I get Java to limit the number of selected items to only four (no…
ironmantis7x
  • 807
  • 2
  • 23
  • 58
0
votes
3 answers

actionListener on jcheckbox

I am trying to add an anonymous actionListener to a JCheckBox but having some difficulty in accessing the object I want to update the value with. I keep getting errors about non final, and then when i change them to be final it complains about…
user1584120
  • 1,169
  • 2
  • 23
  • 44
0
votes
1 answer

JAVA: JCheckBox lost selection in a JTable when Button pressed

I have this problem: added a jcheckbox in a jtable. In my model this jcheckbox is loaded with getValueAt and used the method setValueAt when selected by the user. No problem until I push the confirm button, when all my row selected (true value)…
0
votes
1 answer

Unable to vertically align JLabel with JCheckBox as if single JCheckBox with GroupLayout

Sometimes I need the label for a checkbox to be to the left of the checkbox not the right so instead of using JCheckBox checkbox = new JCheckBox("label",false); I do: JCheckBox checkbox = new JCheckBox("",false); JLabel label = new…
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
0
votes
1 answer

Traverse a group of check boxes

How can I traverse a group of check boxes using keyboard arrow keys in Swing? Note: Checkboxes are placed in a gridlayout
Siddhu
  • 1,188
  • 2
  • 14
  • 24
0
votes
2 answers

jCheckbox to be displayed in textarea

I'm experimenting with JCheckBox. What I want is, when I'd check any of them(checkboxes), the text in the checkbox should be displayed in jtextarea. What I have right now is this: import java.awt.*; import javax.swing.*; import…
user1410081
0
votes
1 answer

CheckBox dead loop listener

I have the following listeners: mListener = new ItemListener() { public void itemStateChanged(ItemEvent e) { if (((JCheckBox) e.getSource()).isSelected()) { setRequired(true); …
Fofole
  • 3,398
  • 8
  • 38
  • 59
0
votes
1 answer

Adding JCheckBoxes to All Cells in Column Except Last Cell

In my table model, I return Boolean.class in getColumnClass so that checkboxes are displayed in the first column. Is it possible to add checkboxes to all cells in the first column except the last cell (next to Total)? See screenshot. Thanks!
BJ Dela Cruz
  • 5,194
  • 13
  • 51
  • 84
0
votes
1 answer

Disable JComboBox inside JTable on click of JCheckBox

I have JTable and it has a JCheckBox and a JComoboBox in two different columns. When I select a JCheckBox that corresponds to that row, the JComboBox should be disable. Kindly help me.
0
votes
3 answers

JCheckBox knowing if checkbox is selected or not

To set a JCheckBox is using setSelected method with a boolean condition. Which method do i use to get the boolean data out of the JCheckBox. Thanks
The JAVA Noob
  • 367
  • 4
  • 8
  • 21
0
votes
2 answers

update all TextFields each time a box is checked with java

I have a series of JCheckBoxes(1-20) and each is associated with a JTextField(1-20). I would like all textfields to be updated each time a box is checked. The fields are to be updated with the formula 100/(sum of checkboxes that are checked). So if…
just eric
  • 927
  • 1
  • 11
  • 23
0
votes
3 answers

javax.swing.JCheckBox setSelected is not calling from GUI

I'm trying to extend some Swing components and override methods that interacts with its state (setSelectedIndex of JComboBox, setSelected of JCheckBox, etc). There are problem with JCheckBox. I've override setSelected method, but it seems it does…
user1376983
  • 91
  • 2
  • 7
0
votes
1 answer

JCheckBox not being rendered within JTable (JRE?)

I have a Jtable and intend to add JCheckboxes to it. There is quite a clear example here which I implemented yet kept on getting "true" and "false" String values when running. I then tried to run the example itself and discovered that it too is…
greatkalu
  • 433
  • 1
  • 8
  • 21
0
votes
1 answer

Unable to refresh jtextarea after Selection from JOptionPane drop down list box

The first time I select an option from the list, the value is displayed on the jtextarea The second time I select an option, the value doesn't change. Is there a refresh option? Or a better approach for this problem? Thanks! Here's a snippet of the…
Lily S
  • 245
  • 1
  • 8
  • 18