[4946] in java-interest
Re: dynamic adding Checkbox?
daemon@ATHENA.MIT.EDU (Amy Fowler)
Tue Jan 23 17:39:36 1996
Date: Tue, 23 Jan 1996 12:39:31 -0800
From: Amy.Fowler@Eng.Sun.COM (Amy Fowler)
To: java-interest@java.Eng.Sun.COM, fxia@prime.planetcom.com
>>I need to dynamically add Checkbox into a panel but failed to make the
>>new added Checkbox show up in the panel unless I resize the application
>>window. What happened to the new added Checkbox? I tried all possible
>>methods I know, Checkbox.show(), checkbox.repaint(), thePanel.show() etc.
>>and also checked the visibility of the new Checkbox, it IS true.
Hi Frank,
Yes, the fact that Component.add() doesn't take care of
showing the new component is a bug.
If you are writing an application (opposed to an applet),
you can call pack() on the window to force the new guy to
show up. If you are writing an applet, try calling
panel.validate() as a workaround.
Let me know if you have problems with either workaround --
I hope to get this fixed for the next release (post 1.0).
Regards,
Amy Moore-Fowler
Java Products Group
Sun Microsystems, Inc.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com