• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Container

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
I do some of my very best work in water. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic