aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to select a particular checkbox in a series Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to select a particular checkbox in a series" Watch "How to select a particular checkbox in a series" New topic
Author

How to select a particular checkbox in a series

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Hi everybody, I am having a problem with check boxes. I have 100 check boxes in my JPanel. I have few values in a text file. What I am supposed to do is, read the values from file and check the corresponding check box.

Please tell me how to select particular check boxes. Thank you all in advance.


Love all, trust a few, do wrong to none.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Have you checked out the JCheckBox API? Look for methods which will help you set its selection state (hint)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 806

Hey guys, the problem has been solved. I am using a Map<String,JCheckBox> to store the check boxes.

This is working properly. Hope this approach is correct.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to select a particular checkbox in a series