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
2 answers

JList need twice click to update a CheckableItem

I have this small snippet of code that display a simple panel with a list of checkboxes. The behavior must be the following: if the checkbox "[] all" is selected every other checKbox must be unchecked, otherwise (when the "[] all" checkbox isn't…
microvo
  • 41
  • 1
  • 8
0
votes
2 answers

How do I make JCheckBox work the way I want

I have created a toolbar with a spinner and a checkbox. The spinner works as I expect. When I change the value, the listener is called AND the spinner value is CHANGED. BUT, for checkbox, the listener is fired when I move over it (unlike spinner)…
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
0
votes
1 answer

Java Reading Text File Yielding Null Result

Here I have some code where I create an ActionListener for a JCheckBox. Once the user clicks the JCheckBox the actionlistener is triggered and this code runs. First I check whether they are selecting it or deselecting the check box and I input this…
Nicolas
  • 11
  • 2
  • 8
0
votes
1 answer

Java JCheckBox ActionListener

I have a program that is a list of notes that can be added by the user. Every note is loaded through a for loop and given a JCheckBox on runtime from the notes.txt. How do I add an actionlistener for my JCheckBoxes when they are only instance…
Nicolas
  • 11
  • 2
  • 8
0
votes
0 answers

Add Hide button to JComboBox

I am trying to implement a custom JCombobox where I am trying to have checkboxes (JCheckBox) inside the dropdown and a simple "Hide" button at the bottom which should hide the drop-down menu. Right now my JCombobox has the checkboxes but i dont know…
Ankit Rustagi
  • 5,539
  • 12
  • 39
  • 70
0
votes
2 answers

Array of Jpanel with a button and a checkbox

I have an array of button that displays images after image query. Now I am trying to add a checkbox under each button so user can check if that's a relevant image. I was going to have an array of Jpanel where each Jpanel consist of one button and…
0
votes
2 answers

Deleting selected checkboxes using java swing

I am new to java swing. I have a code that generates checkboxes. I want to have a button somewhere in my frame, which on clicking, should delete the selected checkbox entries. Here is what I have so far. public class Scroll extends JPanel { …
Le_Master
  • 147
  • 1
  • 2
  • 20
0
votes
2 answers

Modifying element in DefaultListModel not updating model

I have a JList that is supported by a DefaultListModel and has a custom CellRenderer. The CellRenderer is for adding support for JCheckBox in my JList. When i try to modify the checked state for an element in the DefaultListModel it does not appear…
prolink007
  • 33,872
  • 24
  • 117
  • 185
0
votes
3 answers

Managing dynamically added JCheckBoxes to JScrollPane

I am working on the functionality of adding JCheckBox to Panel and then adding that Panel to JScrollPane. So far i am done with adding different JCheckBox dynamically to Panel but when i add that same Panel to JScrollPane, it does not shows the…
0
votes
1 answer

Arranging JCheckBox units Vertically

I have created a program in which I display result-filtering options on the side of my Swing window, however by default they appear horizontally next to one another, which wastes the space I have allotted in my BorderLayout's WEST side. Is there…
William Brun
  • 353
  • 2
  • 17
0
votes
2 answers

JButton + AbstractAction to reset a bunch of JCheckBox(s) - Swing

I'm creating a ToolBar with one JButton and some JCheckBoxs to hide or show columns from a JTable. The JButton main purpose is to once clicked reset all the other JCheckBox in the ToolBar to either all checked or all unchecked. Actually I pretend to…
dazito
  • 7,740
  • 15
  • 75
  • 117
0
votes
3 answers

Java swing CheckBox not selected while display Conformation Dialog

I am working on an application in which I have developed a window with three check boxes. When first and second check boxes are selected, new windows will be opened as desired. The third check box is for closing the application. When Exit check box…
Java Developer
  • 165
  • 4
  • 8
  • 18
0
votes
1 answer

CheckBoxNodeTree example - how to correctly implement itemlistener in CheckBoxNodeEditor?

I'm using this implementation for creating my JTree: https://github.com/imagej/imagej/blob/ee3c360949/ui/swing/util/src/test/java/imagej/util/swing/tree/CheckBoxTreeSample.java I have tried to search for a correct way of creating the ItemListener…
cloms
  • 89
  • 2
  • 10
0
votes
1 answer

How do I align my checkboxes in a GridLayout?

I need to align the checkboxes in my GUI, but I'm having trouble finding the right command or method. I have written a short example that is simpler to read: public class GUI { JFrame window = new JFrame(); JPanel mainPanel = new JPanel(); JPanel[]…
Yoshimi
  • 3
  • 1
  • 2
0
votes
1 answer

Java - JCheckBox Filters Against a List

I have a List, that included JPA Entity objects of a certain type. Their reference String values are displayed in a JList for the user to see. I want my user to be able to select filters as JCheckBoxes in the UI such as 'only from Client x', or…
Rudi Kershaw
  • 12,332
  • 7
  • 52
  • 77