This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.
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.