• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

check box

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have check box group if check box is checked i have to uncheck the check box can any body tell how to uncheck the checked check box in group?



thanks in advance








 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the JCheckBox API to see if you find any method to select/deselect the box.
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am using awt
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you been through the API documentation to see whether there are any methods for setting the box as selected or not?
 
Campbell Ritchie
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vijayakumar durai wrote:i am using awt

Why?

And Maneesh has beaten me to it
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why?

can you tell what is difference between swing and awt?
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry ya i did n't see the awt method
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vijayakumar durai wrote:why?

can you tell what is difference between swing and awt?


Swing is more powerful, with a richer set of components including tables and trees.
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vijayakumar durai wrote:can any body tell how to uncheck the checked check box in group?


What part are you having trouble with: determining which box is the checked one, or performing the unchecking?

If the former, one approach is to not bother and just attempt to uncheck them all.



And, dovetailing with with some of the other posters here, if you don't know why you're using AWT over Swing then you should probably just use Swing. (There are situations where AWT is called for, but they are relatively rare and I would think you would be aware of it if you were in one.)
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am doing exam project in this first question will come from database i am creating check box from group. it will have 4 checkbox for options in awt if user select any one checkbox and click next button it will display second question i am displaying question from label i
when icheckedoption for first question it will also checked for second question
i am changing label value using
radioopt1.setLabel

i had given but its not working



 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am creating check box

 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Checkboxes essentially denote multiple choices. As per your description, a Radio button would be an appropriate choice.

Coming back to your problem, "it doesn't work" does not help us help you. Have you ensured (by debugging perhaps) that the uncheck code is really getting triggered? Always share the details
If you had peeked through the CheckBoxGroup API, you would have noticed setSelectedCheckbox method. Read the API documentation to figure out how to deselect all checkboxes in that group.
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
actually i am adding checbox in checkbox group can any body tell how to get the name of selected check box?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you even look at the CheckboxGroup API?
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i saw the api but i am not able to get
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I checked. The API lists 5 (yes, only five) methods.
Even the method description is in simple English.
I fail to understand how we can be more helpful.
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai maneesh

i understood this 5 methods but my requirment is different
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How come?
You want the name of the selected checkbox.
The CheckBoxGroup gives you the selected CheckBox.
Once you got the CheckBox you can get the text.
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


how to get the selected object

 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean the variable name.
What you need is reflection

Why do you want to do it that way? The method getSelectedCheckbox() already gives you the instance.
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks maneesh i gor
 
reply
    Bookmark Topic Watch Topic
  • New Topic