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
Java Swing Showing Button 2X for 1 Click - Why? 0_o
I coded a Java Swing component that shows a button twice when it is clicked. However, I only want the button to appear once when clicked. My code is below. Does anyone know what I am missing?
import java.awt.event.*;
public class checkIt2…

user3808269
- 1,321
- 3
- 21
- 40
0
votes
1 answer
CheckboxGroup of JCheckBoxes
How can I make a CheckBoxGroup of JCheckBox objects? I use:
CheckboxGroup cg = new CheckboxGroup();
JCheckBox c1 = new JCheckBox("A", false, cg);
But this gives:
The constructor JCheckBox(String, boolean, CheckboxGroup) is undefined
Everything is…
user3265784
0
votes
1 answer
What does the public Gui() mean in my code? what is it?
So I was making a Gui and I did the usual stuff, and I always do public Gui() {and have code in it}. what does it mean? Is it a constructor? What is it?
package tacos;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class…

frosty
- 63
- 1
- 9
0
votes
3 answers
Java Swing - Problem in disabling JCheckbox
I am disabling a JCheckbox and then enabling it with the help of setEnabled(...) method.
But the problem is if I disable a unselected checkbox, then it becomes selected after I enable it.
I want all of them to have the same state after being enabled…

Amit
- 33,847
- 91
- 226
- 299
0
votes
2 answers
How to output in JLabel if a JCheckbox is selected?
I am attempting to create a currency conversion program, but the output is not working through a JLabel. I have the program so that there are 6 JCheckboxes, each representing a different currency. When the user presses the "Convert" button, any of…

Connor McNamara
- 11
- 2
0
votes
1 answer
How to add a combo box when a check box is selected?
I'm trying to have an action listener add a combo box to a control panel when only when a check box is selected. For example, the project I'm currently working on is a t-shirt order form. A check box for "Graphic" is available. When "Monogram" is…
0
votes
2 answers
Jcombobox with Jcheckboxes
how can I create (with JAVA) Combobox that contains Checkboxes for multiple selection and display the selected items in the Combobox like this picture:
click to see the pic
and thnx for advance.
EDIT:
I found this API (JAPURA API) and it's great…

Slim EN
- 145
- 2
- 3
- 9
0
votes
1 answer
How do I draw a rectangle every time I click on a JCheckBox?
I am trying to draw a filled rectangle whose color corresponds to the checkbox. The rectangle is to be randomly sized and placed on the JPanel. So far, I have gotten the rectangle to draw to the JPanel with a random size and random location, but I…

webberm63
- 1
- 3
0
votes
0 answers
Why does my Java program select multiple checkboxes at once inside a JTable?
I have an issue when adding checkboxes to a Jtable, or more specifically when selecting a checkbox. I am able to select individual checkboxes, but when I do it automatically selects the other present checkboxes.
ex: First is chosen, then all of the…

ballBreaker
- 722
- 1
- 10
- 29
0
votes
3 answers
How check which jcheckboxes are checked out of 29 checkbox
I have 29 jcheckbox on my jframe, user may select combination of multiple jcheckbox
I can check which are checkboxes are check using a long nest if where I have to use
if(jCheckBox1.isSelected()==true)
and so on....
but combination of 29 checkbox I…

user3599755
- 93
- 3
- 11
0
votes
1 answer
trying to align JcheckBox in a GridBagLayout
I'm working with GridBagLayout and I can't figure why the JCheckBox don't align. I've tried to set alignement as a JCheckBox parameter(i.e checkBox.setAlignementX(LEFT_ALIGNEMENT)). It did'nt worked.
I first tried using BorderLayout, but it turned…

Chax
- 1,041
- 2
- 14
- 36
0
votes
1 answer
How to fetch checked values from check boxes in jtable?
I have JTable with name 'tableEarnings' it consist of 3 columns:
check
Earnings
Description
and a
jButton
Every cell in 'check' column have a checkbox. I need to fetch checked values of 'Earnings' and 'Description' cell from JTable and store…

Jipin Gopi
- 25
- 2
- 7
0
votes
3 answers
ChangeListener doesn't change font in JTextArea
I'm using Java(ver1.42) awt for making chatting program
I made bold & Italic JCheckBox to change font in JTextArea.
Here is the listener for 2 CheckBoxes.
class CheckBoxListener implements ChangeListener {
public void…

Kanghoi Choi
- 69
- 11
0
votes
1 answer
Java JOptionPane woth scrollable checkbutton list
I have a little Problem here. I'm currently working at a GUI to organise my series, that im watching/have watched. In this part I wanted a frame to open with all the different genres in JCheckBox'es, that should return a boolean-array, where each…

TheJustikar1996
- 3
- 2
0
votes
1 answer
Missing check square (JCheckBoxMenuItem) while using Nimbus java look and feel
I changed to Nimbus look and feel, as it is described here.
It works fine except for JCheckBoxMenuItems, where the check squares disappeared. The selection color is incorrect too.
This is the code of the popupmenu with the JCheckBoxMenuItems:
public…

Bence Kaulics
- 7,066
- 7
- 33
- 63