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
1 answer
How do I do an action response for when I untick my JCheckBoxes?
I have a GUI with a bold and italic JCheckBox as well as a textarea. The layout of my GUI is fine but the functionality of my JCheckBox items are buggy. They are supposed to convert any text in the textarea to bold, italic or both depending on which…

DaveRamseyFan
- 45
- 2
- 9
0
votes
1 answer
Bug of Transparent JCheckBox in a JPanel?
Here are my codes for adding the new component:
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if…

ykn121
- 835
- 1
- 9
- 28
0
votes
2 answers
Issue with creating multiple checkbox on a fly
I am trying to read all the file name from a specific folder and trying to create multiple checkbox in JFrame with the same name. So, if there are 5 files in the folder, application should show 5 checkboxes in the frame.
Here is my code.
JFrame…

Naseem
- 911
- 5
- 18
- 48
0
votes
1 answer
Obtain name of JCheckBox java
I try to obtain name of List of JCheckBox but appear a string null. This is my code;
JCheckBox mesi [] = {gennaioCheck, febbraioCheck, marzoCheck, aprileCheck, maggioCheck, giugnoCheck,
luglioCheck, agostoCheck, settembreCheck, ottobreCheck,…

Barbara Privitera
- 29
- 1
- 6
0
votes
0 answers
I have a checkBox and I want to get that data from database.What should I use whether getInt(boolean); or what.Can ayone suggest me the right code
I have a checkbox in a panel.If I click in that checkBox it should be saved.Iam not knowing what should I use.Can anyone suggest me with the right code.Thanks in advance.
Here is my code.
my checkbox name is--check;
…

icesu
- 47
- 8
0
votes
1 answer
Change Boolean from a String to a checkbox (JTable)
I am having a small problem of showing results from my database to a JTable. It displays all of the data correctly, but at the moment it is showing "true" or "false" for boolean.
I know it must be because I am using getString, but does anyone know…

ZenoX
- 117
- 9
0
votes
0 answers
JCheckBox Text overlaps custom icon
I have a JCheckBox with a custom icon. The dimensions of the icon are 32x32 pixels.
When I set some text with horizontal alignment RIGHT, the text is not respecting the icon's width.
screenshot of problem
How can I make sure the text does not…

Robert Walter
- 13
- 4
0
votes
1 answer
Change font style of JTextField when JCheckbox is ticked and JButton is clicked
I don't get the result I want in this code, which is when I click on the checkbox then the JTextField's text should be bold, but It doesn't happen. Help me please.
public class GUI extends JFrame{
//CheckBoxs
private JCheckBox box1;
private…

BombrickJL
- 11
- 4
0
votes
1 answer
How to connect the JCheckBox and JButton to show the number JAVA
private JTextField textFieldSum = new JTextField(1);
public Count() {
super("Project 2");
super.setBounds(150, 150, 500, 500);
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0,…

Leo Kao
- 39
- 8
0
votes
0 answers
exception in thread awt-eventqueue-0 java.lang.nullpointerexception error for checkbox in jtable
I have a JTable, which was built in Netbeans, with a column that is set to Boolean value. To obtain the rows that were checked, the user has to click the 'Reorder' button which checks the table to see which rows were selected.column settings
The…

user44649
- 1
- 1
0
votes
0 answers
Create checkbox bigger
I have a question regarding this way of solving the problem. I need a bigger check box. Partial solution of the problem writer in a method:
private JCheckBox createCheckBox() {
Icon normal = new ImageIcon(...);
Icon selected = new…

Maria
- 1
0
votes
1 answer
Controls keep disappearing from my JFrame, no JPanes or anything to be painted
Here is some of my code. It should be noted that this is not my exact code as I did have much more added, but long story short, I can guarantee that none of the controls touch each other, and that they are all added to this frame. Where then is my…

Rodney Johnson
- 11
- 2
0
votes
2 answers
JTable enable some checkbox column
I have a jtable I populated from a database , but I want to enable or gray out some of this jtable lines ( lines that exist in another table of the same database) for the user cannot check the checkbox of these lines, but the rest of the lines (…

randavas
- 1
- 1
0
votes
2 answers
JCheckbox as indicator?
I need an off/on indicator for a panel in my Swing application.
My gut reaction is to try to use a JCheckbox, and somehow disable the mouse input and change the checkbox state only through my program. But a radio button would look better.
Is this…

Jason S
- 184,598
- 164
- 608
- 970
0
votes
2 answers
How to save and load checkBox states and text Field values in java?
I have been wondering about saving and loading jcheckbox and jtextfields values in Java. Is it possible to save and load jcheckbox and jtextfields values?
I have attached the picture of a small program in which I would like to save the values of…

Latif
- 125
- 1
- 4
- 16