| View previous topic :: View next topic |
| Author |
Message |
John Woods Guest
|
Posted: Sun Jun 29, 2003 5:07 am Post subject: hiding components |
|
|
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
|
Posted: Sun Jun 29, 2003 8:02 am Post subject: Re: hiding components |
|
|
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 |
|
 |
|