[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem with awt.Panel



On Mon, May 12, 2003 at 10:33:18AM +0100, Tom Badran wrote:
> I have an application that uses a borderlayout, where the BorderLayout.CENTER 
> component is a Panel reference, to a class instance that is a subclass of 
> Panel. The initial add is fine, and it all works well, however if i do a 
> remove(Panel) then change the Panel reference to a different subclass of 
> Panel and do an add(Panel) nothing happens. There are no errors, it just 
> doesnt show. If i change back to the other instance that doesnt show either. 
> Both panel instances are initialised at start time, before either is added to 
> the screen.
> 
> Basically my app simply wants to swap which instance is used in the 
> borderlayout.CENTER without ever destroying either instance, and keeping both 
> instances in memory.
> 
> Any ideas? (blackdown sdk btw)

Did you call validate() after adding the new component? If resizing the
window shows the new Panel subclass, that is most likely the solution.

HTH,
Nick

-- 
x----------------------------------------------------------------------x
|              Benford's Corollary to Clarke's Third Law:              |
| Any technology distinguishable from magic is insufficiently advanced.|
|              -- Gregory Benford. Foundation's Fear. 1997             |
|----------------------------------------------------------------------|
| Nicolas Kratz <nick@ikarus.dyndns.org> <n_kratz@cs.uni-frankfurt.de> |
x----------------------------------------------------------------------x

Attachment: pgpALPALj1GKs.pgp
Description: PGP signature


Reply to: