• Post Reply Bookmark Topic Watch Topic
  • New Topic

Look at my problerm plz

 
vamshi krishnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SORRY the exact problem is,we have 5 checkboxes in a frame, and in that we have to select only 3 checkboxes please tell me how to do that problem
thank you
 
Campbell Ritchie
Marshal
Posts: 52558
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Please use titles for your threads which explain what they are about; "How to choose 3 out of 5 checkboxes" would have been far better.

What do you know about the JCheckBox class? Have you explored the Java Tutorial, or the API?
 
Campbell Ritchie
Marshal
Posts: 52558
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and what have you found out about checkboxes?
 
Malith Yapa
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could keep a record of booleans on whether each checkbox is selected or not. The booleans can be updated within the event. Or there might be a property in the checkbox class. I haven't worked with it. Then each time a check box is selected(on the event) you can check how many booleans are true and do what you intend.
 
Campbell Ritchie
Marshal
Posts: 52558
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posted by myself on 13th April:
. . . and what have you found out about checkboxes?
Well, what have you found out?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!