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

JCheckBox boolean reset?

LiL Kunji

Joined: Jun 23, 2001
Posts: 26
i initialize JCheckBox foo = new JCheckBox("more foo",false);
now later in the program i give the user a reset button.
how do i reset this box back to false and the checkmark will be
taken out. thank you
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Lil,
Try this:
foo.setSelected( false ); // clear checkmark
foo.setSelected( true ); // sets checkmark
LiL Kunji

Joined: Jun 23, 2001
Posts: 26
Awesome!!! thank u very much. that did the trick completely!!!
I agree. Here's the link:
subject: JCheckBox boolean reset?
It's not a secret anymore!