• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Container

 
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all, I have this question from internet and I am very confuse about it
Which can not be added to a Container?
a) an Applet
b) a Component
c) a Container
d) a Panel
e) a MenuItem
My answer is b and e
Can someone correct me if I am wrong ?
thanks
daniel
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would say a, b, c, d, are ok,
with some doubts at b, Window is a component but cannot be added...
..Cristian
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a. You CAN add an Applet to a Container, it works (i.e. no compilation or runtime exceptions)
b. You CAN add a Component to a Container
c. You CAN add a Container to a Container since the latter is_a Component
d. You CAN add a Panel to a Container since a Panel is_a Container and from c we know that a Container can be added to a Container
e. You CANNOT add a MenuItem to a Container (only PopupMenu)
So the only correct answer for that question is e.
Now, the question may be tricky since some Containers (Window...) cannot be added to a Container so,...
I'd be happy to discuss about that...
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
[This message has been edited by Valentin Crettaz (edited November 15, 2001).]
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Valentin,
Can you give me some explanations about the meaning of is_a Component ?
thanks
daniel
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic