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

Re: [ProgSoc] java container swapping



On Sat, Dec 10, 2005 at 06:47:31PM +1100, Peter Anthony Brownlow wrote:
> I would like to have the 2 different gui modes as 2 different classes
> and just switch objects when the user clicks the 'switch button' or
> whatever. These 2 containers should occupy exactly the same screen space
> when active.

java.awt.CardLayout

> First I tried removing the first from the parent
> layout and adding the second... it seems that java doesn't like me doing
> this after they've been drawn at least once, as the redrawing stopped.

If you want to do this yourself, you should read up on
Component.validate(). But I recommend letting CardLayout handle this for
you.

> Similar noncommittal results for switching z-order

The spec says nothing about component z-order, therefore you shouldn't
assume anything about component z-order (in fact, different JVMs
implement component z-order in different ways, as it is their choice).

Things are different in Swing.

Ryan

-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@xxxxxxxxxxxxxxxxxxx
If you are having trouble, ask owner-progsoc@xxxxxxxxxxxxxxxxxx for help.