frame.pack() Problem

In my game once you beat a level you see a screen to continue to next level and i use frame.pack(). But after the second time i do this and rest of the times it makes the screen as big as the minimize restore and exit button. how do i fix this?

gratzPanel.setVisible(false);

frame.getContentPane().add (gamePanel);

frame.pack();

gamePanel.setVisible(true);

Message was edited by:

W00t

[494 byte] By [W00ta] at [2007-11-27 6:16:25]
# 1
Probably because your game panel doesn't have a preferred size.
camickra at 2007-7-12 17:28:08 > top of Java-index,Desktop,Core GUI APIs...