AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

hiding components

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
John Woods
Guest





PostPosted: Sun Jun 29, 2003 5:07 am    Post subject: hiding components Reply with quote



I have a JLabel and a JButton in a JPanel with GridBagLayout that I'd like
to hide/appear when the user clicks a button. The problem i'm finding is
that if I use remove() the row which these comps are in seems to disappear
so that when i call add() it puts them in the the last column of the
previous row. Is there away to hide the components while reserving the
space?


Back to top
Jeremy
Guest





PostPosted: Sun Jun 29, 2003 8:02 am    Post subject: Re: hiding components Reply with quote



JComponent.setVisible(false);
Container.repaint();

-Jeremy

"John Woods" <jmwoods (AT) sympatico (DOT) ca> wrote

Quote:
I have a JLabel and a JButton in a JPanel with GridBagLayout that I'd like
to hide/appear when the user clicks a button. The problem i'm finding is
that if I use remove() the row which these comps are in seems to disappear
so that when i call add() it puts them in the the last column of the
previous row. Is there away to hide the components while reserving the
space?





Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.