• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Container

 
sean cee
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Which cannot be added to a Container?
a) Applet b) Component c)Container d) Panel
e) MenuItem or Menu or MenuComponent.
why is the answer e?
I think none is the answer.
or is the question supposed to be "cannot be directly added..."?
then answer e) sounds right....
I am confused.

Thanks heaps
 
P SOLAIAPPAN
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sean,
You will understand, if you go through thr' hierarchy.
Object->MenuComponent->
The sub classes of MenuComponent are
MenuBar
MenuItem
Menu etc.
Here Super class is not "Container" hence you can not add
the above items to a Container.
solaiappan
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wait a second here Component implements MenuContainer - inherited by Container. You can add a PopupMenu to any Component. The inheritance of Object->MenuComponent-> has nothing to do with it.
Only a Frame can have a MenuBar, maybe thats what the question was trying to get at.
Bill
 
P SOLAIAPPAN
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William,
I thing the following explanation is ok.
Container itself is a component, button,applet and component are component. But menu extends MenuComponent which extends Object so it is not a component.
Hence Menu canot be added to a container.
If am wrong, correct me.
solaiappan.


[This message has been edited by P SOLAIAPPAN (edited October 29, 2000).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic