Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

component on applet : from majji exam

 
geetha nagarajan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the following applet, how many Buttons will be displayed?

A) 1 Button with label "Ok" and 1 Button with label "Cancel" .
B) 1 Button with label "Ok" and 4 Buttons with label "Cancel" .
C) 4 Buttons with label "Ok" and 1 Button with label "Cancel" .
D) 4 Buttons with label "Ok" and 4 Buttons with label "Cancel" .
The answer given is :B.
Is it bcos ,the init() is called only once ???
Pl.clarify.
[ June 06, 2002: Message edited by: geetha nagarajan ]
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B'cos only one instance of "Ok" button is created whereas 4 new instances of "Cancel" buttons are created.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this code shows adding a component to a Container removes it from anyone in which was before. ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic