JDK-6562069 : LiveConnect : Repainting and hanging problems with different liveconnect scenarios involving GUIs
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u2,6u7
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows,windows_xp
  • CPU: generic,x86
  • Submitted: 2007-05-25
  • Updated: 2010-12-06
  • Resolved: 2007-06-30
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.
6u4 b01Fixed 7Fixed
Build Tried : Promoted 6u2 JRE build
OS : Windows XP
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

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

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

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.