Splatt
September 14th, 2000, 12:37 PM
Here's the situation:
I have a JPanel (call it mainPane) contained within a JFrame (call it mainFrame). It is added via
mainFrame.getContentPane().add(mainPane);
To mainPane I am adding and removing other JPanels. What I would like to do is that whenever a JPanel contained in mainPane is removed or set invisible the window shrinks to show the deletion, so that the space taken up by the pane is no longer there. Right now whenever a pane is set invisible it still takes up room, and so the window doesn't shrink. I'm left with these big empty spaces.
Any ideas would be most appreciated.
Thanks!
"There's nothing more dangerous than a resourceful idiot." ---Dilbert
I have a JPanel (call it mainPane) contained within a JFrame (call it mainFrame). It is added via
mainFrame.getContentPane().add(mainPane);
To mainPane I am adding and removing other JPanels. What I would like to do is that whenever a JPanel contained in mainPane is removed or set invisible the window shrinks to show the deletion, so that the space taken up by the pane is no longer there. Right now whenever a pane is set invisible it still takes up room, and so the window doesn't shrink. I'm left with these big empty spaces.
Any ideas would be most appreciated.
Thanks!
"There's nothing more dangerous than a resourceful idiot." ---Dilbert