United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6562069 LiveConnect : Repainting and hanging problems with different liveconnect scenarios involving GUIs
JDK-6562069 : LiveConnect : Repainting and hanging problems with different liveconnect scenarios involving GUIs

Details
Type:
Bug
Submit Date:
2007-05-25
Status:
Resolved
Updated Date:
2010-12-06
Project Name:
JDK
Resolved Date:
2007-06-30
Component:
deploy
OS:
windows_xp,windows
Sub-Component:
plugin
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u2,6u7
Fixed Versions:
6u4 (b01)

Related Reports
Backport:

Sub Tasks

Description
Build Tried : Promoted 6u2 JRE build
OS : Windows XP
Problem:
There are some serious painting issues when a Java based GUI windows is invoked as from a javscript or exercising any Java > JS > Java scenario. It can even led to hanging of browser.

Steps to reproduce
------------------
Applet 1 :
1) Try loading the following applet in firefox or mozilla
http://sqeweb.sfbay.sun.com/deployment2/jitu/deployment_mustang_UR_int_ws/deployment/src/plugin/LiveConnect/LiveConnect/html/RoundTripNonEDT.html

2) Click on the "callJava" Button. Modal dialog should be there.
3) Try to move the modal dialog over the browser window. You can see repainting is not getting done properly.
4) Try to hide the browser window under some other active window and then try to bring focus back again to Modal dialog. if the browser hangs then hanging issues is reporduced.

Applet 2 :
1) Try loading the following applet in firefox or mozilla or IE
http://sqeweb.sfbay.sun.com/deployment2/jitu/deployment_mustang_UR_int_ws/deployment/src/plugin/LiveConnect/LiveConnect/html/RoundTripModalEDT.html

2) Click on the "JavaToJS" Button. Modal dialog should be there.
3) Repainting issue on Frefox/mozilla can also be reproduced with this applet also.
4)If the browser hangs then the problem is reproduced

                                    

Comments
EVALUATION

There are at least 3 problems associated with this bug report
1) browser painting issue
   This is Firefox specific issue and can be demonstrated by the RoundTripNonEDT.html
   applet. Once the dialog is up, move the dialog on top of the browser and you won't
   see applet being repainted.

2) hang issue
   This can be demonstrated by the RoundTripModalEDT.html applet with both IE and FF
   browsers. There's an easy workaround for the hang issue by performing the actual
   displayFrame on an EDT via invokeLater. Workaround as follows:
  public void frameDisplay(final String msg) {
    try {
        SwingUtilities.invokeLater( new Runnable() {
            public void run() {
                doFrameDisplay(msg);
            }
        });
    }catch(Exception e){
    }

  }

  public void doFrameDisplay(String msg) {
    Container frame = this;
    while(frame != null && !(frame instanceof Frame))
      frame = frame.getParent();
    d = new Dialog((Frame)frame,"Java AWT Popup",true);
    Container c = d.getParent();
    System.out.println(c);
    d.setLayout(new GridLayout(2,1));
    Panel p1 = new Panel();
    Panel p2 = new Panel();
    dbutton = new Button("OK");
    p2.add(dbutton);
    dbutton.addActionListener(new ButtonAction1());
    l=new Label(msg);
    p1.add(l);
    d.add(p1);
    d.add(p2);
    d.setSize(100,100);
    d.pack();
    d.setVisible(true);
    boolean s = d.isModal();
    System.out.println(s);
    d.addWindowListener(new WindowAdapter() {
      public void windowClosing(java.awt.event.WindowEvent evt) {
        d.setVisible(false);
      }
    });
  }

3) applet area painting issue
  With the RoundTripModalEDT applet, on clicking on the "callJava2" button. 
  If you move the second alert box over the applet area, the applet area won't get
  repainted. This is expected because when the second alert box is up, java is 
  waiting for the javascript operation to complete - waiting for the use to dispose
  the alert box.

Will address problem #1 in the near term.
                                     
2007-06-01



Hardware and Software, Engineered to Work Together