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
-1
votes
3 answers

Null pointer exception when trying to set a checkbox

I am trying to set a checkbox to being selected if it finds the word "true" at a particular point in an array called saved_mat. System.out.println(saved_mat[0][15]); if(saved_mat[0][15].equals("true")){ e1_10e.setSelected(true); …
ghodnett
  • 35
  • 8
-1
votes
3 answers

Getting value of checkbox from jtable in java

I have a problem to get value of checkbox from jtable in java, that is when i get value by this code "table.getvalue(0,1)" then i can not get the right value.
Fisol Rasel
  • 359
  • 2
  • 5
  • 7
-2
votes
1 answer

Java checkbox state in another class

How to pass actual checkbox state (true/false) from GUI class to another class? I want to run some part of code only if checkbox in GUI is selected. I guess it has to be if statement (highlithed part below) but i cant get it working. public class…
euranoo
  • 69
  • 1
  • 11
-2
votes
1 answer

JApplet will not initialize when Listener is added to jcheckBox

Alright, since it didn't work out last time. I'm going to post my full code here and i hope i can get some replies as to why it's not working. I'm not getting any compiling errors, the applet runs and then nothing shows up and at the bottom it says…
Stan Harris
  • 15
  • 1
  • 4
-2
votes
2 answers

JCheckBox, something wrong with my constructor.

The "public Dorm()" area in the middle is giving me an error. Am I missing something before declaring the constructor? I don't see how it is an illegal start of expression. import java.awt.*; import java.awt.event.*; import javax.swing.*; public…
Nick Wilson
  • 61
  • 1
  • 10
-2
votes
1 answer

JCheckBox uncheck

Well, im saving reports but I've been having some trbs with the JCheckBox.. What i want to do is: When i click NO button, need no to save the file & unchecked the JCheckbox. Due to everytime I press or click JCheckbox button actives the…
man
  • 35
  • 9
-2
votes
1 answer

Null Exception on JCheckBox listener

I've got two classes that each have a JCheckBox used to toggle a "Create" or "Edit" mode. My code works in one of them, but I'm getting a NullPointerException in the other class. As far as I can tell, the code is pretty much the same in both…
Kyle Walker
  • 559
  • 3
  • 12
  • 25
-3
votes
2 answers

JCheckBox issue in Java?

This is my code here in this i want to get output as following but some error is there ---Outputs---- Name Arun.Gender Male. He likes nothing. Name Arun.Gender Male. He likes Cricket only Name Arun.Gender Male. He likes Cricket and Tennis. Name…
Symon Kt
  • 73
  • 1
  • 2
  • 11
-3
votes
1 answer

How do I change the background color in java using a checkbox?

I want to change the color of the java program through a checkbox.I have been working on this program, and these are just final steps to success.I dont wanna add more details.dfftwe5trtwtrewghdsgrteegytehyedtnhtfdbeghd. here is what I currently have…
user258748
  • 1
  • 1
  • 1
-3
votes
4 answers

Even if no errors on Compilation and Runtime, Program output is not as expected

A Java Swing applet which includes 3 Checkboxes and a TextField. The specified checkbox when clicked displays title assigned to the corresponding checkbox in the given TextField. The problem is that even if no errors on Compilation and Runtime, a…
-3
votes
2 answers

Problems with ItemListener in Java

I am creating a simple Bold And Italic checkbox which will change the font style written in the text field t1. I did this but it dint help. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class S4 extends JFrame implements…
vs_lala
  • 715
  • 2
  • 8
  • 18
-4
votes
1 answer

How to use one JCheckBox only

I been searching all the websites and also in youtube to find out how to use to use one jcheckbox in my project. I want to function this checkbox as enable and disable, also i want to use to inter single data into database table
-7
votes
3 answers

Else without if error?

I want to know why this code is giving me this problem, keep in mind that it has already worked in an earlier Form of the same project but it refuses to work here. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){ …
user3738449
  • 25
  • 1
  • 3
1 2 3
40
41