File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 800

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: 9990
    
    7

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: 800

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.
 
Consider Paul's rocket mass heater.
 
subject: How to select a particular checkbox in a series
 
Similar Threads
JavaScript function on Input type dynamically generated
Need Script
how to get selected check box values in struts?
doubt
Problems with form validation