Thanks for the replies.
I have been doing some investigations and would like to report my results and ask for
comments. Below is a very simple program involving a JFrame, a BorderLayout, and a bunch
of buttons. Nothing is
rocket science, and one would suspect that everything should work
as expected. But, it doesn't. My eventual problem involves using a JXPanel and some horrendous
repaint behavior. I have not been able to reproduce this behavior in a small postable program yet,
but I believe it is related to the behavior below. The repainting behavior involving the JXPanel is
highly system dependent. I will post about this later.
I have tried the program on the following systems:
1) My home desktop running Windows 7.
a) This is a new computer (Dell) with very good monitor and graphics card (Not gaming).
2) My office computer running XP Professional
3) Dell laptop running Vista
4) Sony laptop running XP (four years old)
The steps that I take are the following:
1) Run the program
a) A small JFrame appears in the upper left corner of the screen.
2) Use the mouse to grab the lower right corner of the JFrame.
3) QUICKLY resize the JFrame to almost full size of the screen.
4) Observe repaint behavior.
5) In all cases, the final layout is correct!
The results are as follows:
1) On the Windows 7 machine
a) The new border of the JFrame is evident at the new position.
b) The space between the new border and the original layout is filled with black.
c) The layout "snaps" to the final position.
d) The "snapping" is delayed if a more complicated layout is used.
2) On the XP Professional machine
a) Behoviour is as expected -- immediate resizing of JFrame and layout
b) On more complicated layout, behavior is as below but "less".
3) On laptops (it is hard to resize quickly and screen size is smaller)
a) Multiple instances of the JFrame border in the intermediate positions are seen.
b) The area inbetween the original layout and the new border appear to be transparent
c) The final layout appears or "snaps" to new border.
d) Behavior is more pronounced on more complicated layout.
My analysis. The behavior seems to be the same except that Windows 7 erases the extra region between each
paint of the JFrame border rather than let it be transparent. Thus, you do not see the intermediate borders as
they have been erased.
I then performed the following experiment on the Windows 7 machine. All frames were reduced to a small size
and then quickly resized as above.
1) A Notepad frame - resizes nicely
2) An Opera browser frame -- Black areas are noticable as above.
3) An Eclipse
IDE frame -- resizes nicely even though the layout is VERY complicated.
4) An Explorer browser -- resizes nicely except some black for one button (you would never notice if you weren't looking).
Questions:
What do the programs that don't show the visual artifacts of resizing do differently?
Why is their resizing continuous and mine and Opera's resizing "discrete"?