Add a component dynamically at runtime to an applet ??
felicitas
Greenhorn
Joined: Sep 05, 2000
Posts: 3
posted
0
Hi, how to add a Component (Label ...) dynamically at runtime to an applet ? I've tried various possibilities, but I haven't had any success. Thanks, Felicitas
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
I guess your are trying to added components when an event ocuurs. this should be more or less the same way you add components to the Applet. Make sure that you have a specific layout and components are not overlapped.
felicitas
Greenhorn
Joined: Sep 05, 2000
Posts: 3
posted
0
Hi, if I do so, I don't see my added components. I only see them, after clicking the 'restart' button in the AppletViewer. ... what's the matter ??
Stephanie Grasson
Ranch Hand
Joined: Jun 14, 2000
Posts: 347
posted
0
felicitas, I think the reason you are not seeing the new Label is you are not updating the Applet correctly. Maybe the example below will help.