weird insets change in JFrame subclass
I have a strange problem concerning one of my classes that extends JFrame.
The application using it starts with a dialog with a listener registered to it that builds and displays a game window (class GameFrame; the class in question) whenever the user chooses OK in the dialog. When this window is closed it is disposed (using DISPOSE_ON_CLOSE as closing operation) and another listener re-enables the dialog by making it visible again. Then the play can start again.
GameFrame objects provide an init routine that takes care of layout and sizing. The latter duty causes problems: The frame contains a component I want to size depending on the maximum available (screen) space. Therefor, I first pack the (empty) GameFrame to get it's insets through a call of JFrame.getInsets() and then calculate the available space on the basis of the insets and Toolkit.getDefaultToolkit().getScreenSize(). Since some of my calculations were faulty I checked the insets I used and I noticed that the first window created by the dialog's listener has insets [top=25, left=5, bottom=5, right=5] and any following window created the same way (without restarting the application) has insets [top=24, left=5, bottom=6, right=6].
I have no idea what the reason is since I definitely create a new GameFrame object each time. Any suggestions?