JDK-6351820 : 6351820: JFrame is painted incorrectly the first time.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-11-17
  • Updated: 2010-04-02
  • Resolved: 2005-11-21
Related Reports
Relates :  
Relates :  
Description
JFrame with insets set and a component added to it, is not painted properly (on the first time)and shows the desktop background when the test is launched.
Steps to reproduce;
1)Comile and execute the attached test with build mustang b59.
$JAVA_HOME/bin/java FramePaintBug
Observed:JFrame is not painted properly.
Minimise and Maximize the JFrame back and the repaint causes the JFrame to be rendered correctly.

2) Execute the test with the command line system property set as swing.handleTopLevelPaint=true
$JAVA_HOME/bin/java swing.handleTopLevelPaint=true FramePaintBug
Observed:JFrame is not painted properly.
Minimise and Maximize the JFrame back and the repaint causes the JFrame to be rendered correctly.

3) Execute the test with the command line system property set as swing.handleTopLevelPaint=false 
$JAVA_HOME/bin/java swing.handleTopLevelPaint=true FramePaintBug
Now the JFrame is painted PROPERLY.

This is observed since build b32 and is probably a regression to the gray rect fix 4967886.

Comments
EVALUATION From Denis: > I am surprised such code works even in some cases. There are many > places in our peer code where we rely on the insets, and if the peer > insets are different from the contents insets, many strange artifacts > may happen. As such, I'm closing this out as will not fix. We may end up changing the doc for getInsets suggesting Frames/Windows should not override it.
21-11-2005

EVALUATION This isn't really new, you could see the same behavior on 1.5 when you set sun.awt.noerasebackground=true.
18-11-2005

EVALUATION This one is different. Will exchange email with Denis on how to handle this.
18-11-2005

EVALUATION I think this is a duplicate of a bug I filed and ###@###.### fixed already.
17-11-2005