JDK-6859086 : Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: generic
  • Submitted: 2009-07-10
  • Updated: 2015-10-07
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7
5.0u38Fixed 6u17-revFixed 7 b123Fixed
Related Reports
Relates :  
Description
JOptionPane's dialog window doesn't repaint sometimes.

FULL PRODUCT VERSION :

  - Reported on JDK 6u7

FULL OPERATING SYSTEM VERSION :

  - Reported on Windows Vista SP1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

  We can reproduce the problem using the following sample program by clicking "OK" repeatedly. It is difficult to predict the number of trials (clicking "OK") that we need to reproduce the symptom, but
the symptom seems to reproduce once per about 1000 trials.

---------- BEGIN SOURCE ----------
public class Main {
  public static void main(String[] args) {
    for (int count = 1; count < 2000; ++count) {
      System.out.println("[" + count + "]");
        JOptionPane.showMessageDialog(null, "Messages", null, JOptionPane.INFORMATION_MESSAGE);
    }
  }
}
---------- END SOURCE ----------

You can also get the original Japanese (ja_JP.PCK / Shift-JIS encoding) version of this sample program at:
    /net/cores.central/cores/dir16/71173356/Main/Main.java


EXPECTED VERSUS ACTUAL BEHAVIOR :

  Expected:
    The inner area of the dialog is always painted normally, and "Messages"
    string and "OK" button appear.
  Actual:
    The area is sometimes not repainted, and "Messages" and "OK" button
    are invisible. (The "OK" button is invisible but active/clickable.)
    Please see /net/cores.central/cores/dir16/71173356/my_screenshots/*.JPG .

REPRODUCIBILITY :

The problem doesn't exist on solaris / linux but reproduce it on windows.
  - Tested and reproduced on Windows Vista (and SP1, SP2) and Windows XP (and SP2, SP3)
  - Reproducible on JDK 1.5.0, JDK 6 and JDK7ea (b63)


CUSTOMER WORKAROUND :

Nothing.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/jdk/rev/90dcea60577e
25-12-2010

SUGGESTED FIX see 6u17-rev for fix description. webrev for jdk7: http://jpsesvr.sfbay.sun.com:8080/ctetools/html/ViewDetail.jsp?index=3850
29-11-2010

EVALUATION The most likely cause of the problem is a GDI resource leak. See if you could track GDI resources consumed by the java process with either task manager or process explorer.
16-07-2009

EVALUATION Based on my experiments, the problem is reproducible on Windows Vista using latest jdk7 b64 build (with -Dsun.java2d.d3d=false option) and it's not reproducible with -Dsun.java2d.d3d=true option. So, using a different pipeline fixes the problem. Taking this into account, it's unlikely that the problem is an AWT issue. Transferring to Java2D team for further evaluation.
16-07-2009

EVALUATION At first glance it appears it might be an AWT issue as we are not getting windows message. Reassigning to AWT team to have a look.
14-07-2009