United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6859086 : Dialog created by JOptionPane.showMessageDialog does not repaint sometimes

Details
Type:
Bug
Submit Date:
2009-07-10
Status:
Closed
Updated Date:
2012-08-23
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
client-libs
OS:
windows_vista
Sub-Component:
2d
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u14
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

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

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.
                                     
2009-07-14
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.
                                     
2009-07-16
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.
                                     
2009-07-16
SUGGESTED FIX

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

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



Hardware and Software, Engineered to Work Together