This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 24183

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??
Similar Threads
How to create border or change color in a JTable cell?
Problem in JTable row selection
check box in the JTable
Custom Cell Renderer for JTable
JTable with custom checkbox cell editor - problem with the table MouseListener