File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes adding Checkboxgroup to a panel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "adding Checkboxgroup to a panel" Watch "adding Checkboxgroup to a panel" New topic
Author

adding Checkboxgroup to a panel

shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi,
Is this statement valid?
topPanel.add(cbg);
topPanel is of type Panel and cbg is of type CheckboxGroup.
Rgds,
Shree

Regards,<BR>Shree
shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi,
Regarding the above question, i checked the api doc and found there is no add method for CheckboxGroup. Then , how do you add a CheckboxGroup object to a panel?
Rgds\
Shree
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi Shree,
I just finished working my way through the AWT ;
Here's some sample code for working with Checkbox and CheckboxGroup

I don't think there is any way to add a CheckboxGroup, per se, to a container; as it is NOT a component, it inherits directly from Object. Instead, you need to create a CheckboxGroup object, and assign the individual Checkbox items to the group. Then add the Checkbox items to the panel.
Hope that helps.

------------------
Jane
The cure for boredom is curiosity.
There is no cure for curiosity.
-- Dorothy Parker


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi Jane,
It works. Thanks
Rgds,
Shree.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding Checkboxgroup to a panel