Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Delete a panel inside a panel (2)

Reply
Thread Tools

Delete a panel inside a panel (2)

 
 
HS1
Guest
Posts: n/a
 
      12-07-2004
Hello

After got a help, I can delete a sub-panel inside a main-panel (a container
with VerticalFlowLayout) for a delete button ( the button inside a
sub-panel) by using:

JPanel mainPanel = (JPanel)this.getParent();
mainPanel.remove(this); // "this" is the sub-panel
mainPanel.repaint();

However, when I use this code, the sub panel is deleted but the main panel
did not change. For example I have three sub-panels (top, centre, bottom).
When I delete the centre sub-panel, this sub-panel is deleted but the top
and bottom still in the same place. What I want is that the bottom sub-panel
will move up. Do I have to remove all sub-panels then add them again or
there is a better way to do that???

Could you please help
Thank you
SH1


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      12-07-2004
On Wed, 8 Dec 2004 08:49:16 +1300, HS1 wrote:

> What I want is that the bottom sub-panel
> will move up.


Probably validate()/pack(). For more specific answers,
we'd need more specific code.
<http://www.physci.org/codes/sscce.jsp>

BTW - best group for GUI questions..
<http://www.physci.org/codes/sscce.jsp>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      12-07-2004
On Tue, 07 Dec 2004 21:41:19 GMT, Andrew Thompson wrote:

> BTW - best group for GUI questions..
> <http://www.physci.org/codes/sscce.jsp>


...ahem. Rather <http://www.physci.org/codes/javafaq.jsp#cljg>
 
Reply With Quote
 
HS1
Guest
Posts: n/a
 
      12-07-2004
Thanks
I use validate and it works
Thank you for the link

"Andrew Thompson" <(E-Mail Removed)> wrote in message
news:ltukreefh3j1$.wfgmmirgsbhb$(E-Mail Removed)...
> On Tue, 07 Dec 2004 21:41:19 GMT, Andrew Thompson wrote:
>
> > BTW - best group for GUI questions..
> > <http://www.physci.org/codes/sscce.jsp>

>
> ..ahem. Rather <http://www.physci.org/codes/javafaq.jsp#cljg>



 
Reply With Quote
 
Babu Kalakrishnan
Guest
Posts: n/a
 
      12-08-2004
HS1 wrote:
>
> I use validate and it works
> Thank you for the link
>


Better to use revalidate() instead of validate() for Swing components.

BK



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing Java Control Panel in START menu->Control Panel: Diff javacpl.cpl and javacpl.exe? Robin Wenger Java 0 08-18-2011 06:38 AM
Why is there no "Java Control Panel" for J2EE v5upd14 ? Reinstall Java Control Panel possible? Ulf Meinhardt Java 0 07-07-2009 08:38 AM
Swing, JTabbedPane/Panel/Panel JC Java 1 08-09-2006 09:44 PM
Delete a panel inside a panel HS1 Java 3 12-07-2004 10:50 PM
Email From Forms with asp:panel.(s) Only one panel works? Harry ASP .Net 3 11-10-2003 03:13 AM



Advertisments