Re: Replacing Components in a JPanel
From: Stella (stefaan.hallet_at_tiscali.be)
Date: 10/15/03
- Next message: maRIO5: "Re: Eclipse for Linux, installation?"
- Previous message: Bryce (Work): "Re: Eclipse for Linux, installation?"
- In reply to: Hal Vaughan: "Replacing Components in a JPanel"
- Next in thread: Hal Vaughan: "Re: Replacing Components in a JPanel"
- Reply: Hal Vaughan: "Re: Replacing Components in a JPanel"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 15 Oct 2003 23:27:57 +0200
You can try "invalidate()" on the container. Adding of a component doesn't
always trigger the layout manager to relayout the container and by
invalidating the container the layout manager will be triggered to do
relayout. The first time the layout manager will be triggered by the
show().
Stellah
"Hal Vaughan" <hal@thresholddigital.com> schreef in bericht
news:NQhjb.787330$uu5.137635@sccrnsc04...
> I have a JPanel in a window and I am putting different components in it as
> the user goes through a setup wizard. In theory, I have an array of
> components (other JPanels), and I want to step through them, displaying
> panel_0, then panel_1....
>
> I have no problem removing panel_0 from the JPanel parent (I've even done
a
> repaint() right after removing to be sure of this), but no matter what I
> do, I can't seem to do an "add(panel_1)" to the sampe panel. It's the
same
> method I'm using to add the first panel, before I show() the window, but
> once I remove a component and try to add another in its place, I get a
> blank.
>
> Is there a reason I can't add components? Is it because the window is
> visible? What do I need to do?
>
> Thanks!
>
> Hal
- Next message: maRIO5: "Re: Eclipse for Linux, installation?"
- Previous message: Bryce (Work): "Re: Eclipse for Linux, installation?"
- In reply to: Hal Vaughan: "Replacing Components in a JPanel"
- Next in thread: Hal Vaughan: "Re: Replacing Components in a JPanel"
- Reply: Hal Vaughan: "Re: Replacing Components in a JPanel"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|