Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some observations regarding Containers.

 
Trupti Samel
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3711
10
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for showing me the correct way.
Regards,
Trupti.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic