File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to uncheck JCheckBox?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to uncheck JCheckBox??" Watch "How to uncheck JCheckBox??" New topic

How to uncheck JCheckBox??

Kevin Ng

Joined: Aug 31, 2003
Posts: 23
Dear all members,
Normally when u want to set the text inside a JTextField u sure will provides the code like nametxt.setText(""); right?
Then how about if i want to set the check box into uncheck situation, i meant clear the check after performed some actions.
And normally if you want to find a record you will write the code as name.getText() right. I'm having a table which has a column name called reminder, once i click on the JCheckBox in my application a word called 'Remind Me!' will store into my reminder column of my table so how am i going to get the data and showing check or uncheck on the JCheckBox when i finding the entire records using my application?
Thank you and i hope not confusing you all.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

I didn't really understand the part about the table (what is the question exactly?) but to uncheck a JCheckBox, just call setSelected(false) .

[Jess in Action][AskingGoodQuestions]
Kevin Ng

Joined: Aug 31, 2003
Posts: 23
About table part....
How can the JCheckBox automatically selected or unselected based on the database. If the column of the databse is selected then the JCheckBox in my application should selected.
Thank you so much!
[ September 18, 2003: Message edited by: Kevin Ng ]
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
First, get data from the database. Depending on the value of the column in database, check or uncheck the checkbox.
I agree. Here's the link:
subject: How to uncheck JCheckBox??
It's not a secret anymore!