> The problem is that I think that setting the JFrame resizable to false causes an increase in the panels size...
in a
test program, I also see this, but a lot more often than 1 in 50 (
java 1.6, win 7),
and if a timer delay is used to print the specs, it is always increased, so possibly the
times when the specs are the same, it is some calculation error (?)
at all times, the frame specs are the same 656x518. (see additional note ***, below)
at all times, when resizable(true) the panel/contentPane specs are 640x480.
most times, when resizable(false) the panel/contentPane specs are 650x490,
but occasionally (1 in 4 or 5) the specs are 640x480.
the 1 sec delay timer code always produces specs of 650x490.
my guess is because the default L&F uses the OS for the titlebar and it's border, and
java has no access to these, the 'resizable' arrows are triggered from a border added
to one of the frame's internal panes (rootPane?).
if you use
JFrame.setDefaultLookAndFeelDecorated(true);
where java does control the titleBar and borders (hence no need to add additional border
for resizable arrows), all the numbers come out correct i.e. all at 640x480
also, the frame specs change from 656x518 to 650x513 ***<-----------------
don't know what the fix is, but here's my test program if you want to play around with it