• 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

Some observations regarding Containers.

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,
Some Observations :
1. Container can be added to a container.
2. Panel can be added to a container, Similarly container can be added to a panel.
3. Container can be added to any Panel,Window,Frame, Dialog.
4. Panel can be added to Container,window, frame,Dialog.
5. Window,Frame,Dialog cannot be added to themselves eg .Window to window or frame to window.
6. Window ,Frame ,Dialog cannot be added between themselves ed.Frame to window or window to a frame .

7. Window,Frame,Dialog cannot be added to a container.
Am I right? Do add if anything is remaining in this list.Please do correct me if anything is missing.
Regards,
Trupti.
 
Enthuware Software Support
Posts: 4803
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, You do not need to remember such long list. And in fact, I would advise against understanding this stuff through this kind of a list.
There are only 2 simple rules:
1. Any Component except a Window (ie. Frame, Dialog) can be added to any Container.
2. Every Container is a Component. (Because Container extends Component!)
In almost all of the cases, the name of the class is a clear indicator whether you can add stuff to it or not. For. eg. it doesn't make sense to add components to a Button or say List or TextArea! But it does make sense to add components to Panel, ScrollPane etc.

Note: MenuBar is not a Component. It is a MenuComponent and can be added only to a Frame.
HTH,
Paul.
------------------
SCJP2, SCWCD Resources, Free Question A Day, Mock Exam Results and More!
www.jdiscuss.com
Get Certified, Guaranteed!
JQPlus - For SCJP2
JWebPlus - For SCWCD
JDevPlus - For SCJD
 
Trupti Samel
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for showing me the correct way.
Regards,
Trupti.
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic