File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to select a particular checkbox in a series

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked out the JCheckBox API? Look for methods which will help you set its selection state (hint)
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic