JDK-6254441 : IFrame in Applet flickers
  • Type: Bug
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Affected Version: 1.4.2_07
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-04-13
  • Updated: 2010-04-03
  • Resolved: 2005-07-26
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
1.4.2_10 b01Fixed 6Fixed
Related Reports
Relates :  
Relates :  
Description
OS: Windows XP
Service Pack 2
Processor 1.5 GB 599 MHz, 992 MB RAM.
Installed JDK: j2sdk1.4.2_07

To compile:

1. Install the JDK1.4 and ensure the bin folder is in the system path
2. javac -classpath . TestApplet.java

To test:

1. Double-click on the index.html file to open in IE
2. Scroll down in the iframe and you'll see the flickering

-------------------
TestApplet.java
-------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class TestApplet extends JApplet 
implements ActionListener
{
  public void start()
  {
    getContentPane().setBackground(Color.blue);
    getContentPane().setLayout(new BorderLayout());
    JButton b = new JButton("Do Nothing");
    b.addActionListener(this);
    getContentPane().add(b, BorderLayout.CENTER);
  }

  public void update()
  {
    System.out.println("Update");
  }

  public void actionPerformed(ActionEvent event)
  {
    System.out.println("Click");
  }
}

-------------------
index.html
-------------------
<html>
  <head>
    <title>TestApplet</title>
  </head>

  <body>
    <object
      classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
      codebase="j2re-1_4_2_03-windows-i586-p.exe#Version=1,4,2,3"
      id="Desktop"
      style="position:absolute; left:0; top:0; width:300; height:300; visibility:visible"
      hspace="0"
      vspace="0">

      <param name="code" value="TestApplet.class">
      <param name="codebase" value=".">
      <param name="type" value="application/x-java-applet;version=1.3">
      <param name="scriptable" value="true">
      <param name="mayscript" value="true">
	</object>

	<iframe id="Layer1" name="Layer1" style="position:absolute; left:210; top:10; width:280; height:280; visibility:visible;"
		frameborder="no" scrolling="auto" src="http://www.msn.com" application="yes">
	</iframe>

  </body>
</html>

###@###.### 2005-04-13 03:05:02 GMT

Comments
EVALUATION the fix causes a regression bug 6367496
04-01-2006

EVALUATION As stated in a related CR, there are too many background paint calls being made in the code. Look in the "WorkAround" section. ###@###.### 2005-05-19 22:19:45 GMT In the "AxControl.cpp" file, there is a branch in the code which handles window resizing. This branch makes a call to the Windows API "SetWindowRgn". However, this call is made even when an overlapping IE embedded iframe is scrolled on top of an applet. As a result, the applet is unnecessarily being repainted during the scrolling. The fix is to replace the "SetWindowRgn" call with "GetUpdateRgn" call. This call only updates the dirty regions. In the case of iframe scrolling, there are no dirty regions so no repaint happens. This also maintains the original intent of the code branch, window resizing. When the window is resized, this API also takes care of repainting the dirty regions. ###@###.### 2005-07-18 18:35:06 GMT
19-05-2005

WORK AROUND 1) Bring up "Java Plug-In Control Panel" by clicking on the icon in Windows "Control Panel". 2) Click on the "Advanced" tab. 3) Go to the text field labeled "Java Runtime Parameters" and type in "-Dsun.awt.noerasebackground=true". 4) Push the "Apply" button and close "Java Plug-In Control Panel". 5) See if the problem still shows up. If it does, try rebooting Windows after the above instructions and try again. ###@###.### 2005-05-19 22:19:45 GMT
19-05-2005