JDK-6254441 : IFrame in Applet flickers
  • Type: Bug
  • Status: Resolved
  • Resolution: Fixed
  • Component: deploy
  • Sub-Component: deployment_toolkit
  • Priority: P3
  • Affected Version: 1.4.2_07
  • OS: windows_xp
  • CPU: x86
  • Submit Date: 2005-04-13
  • Updated Date: 2010-04-03
  • Resolved Date: 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 Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6
1.4.2_10 b01Resolved 6Resolved
Related Reports
Relates :  
Relates :  
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

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

public class TestApplet extends JApplet 
implements ActionListener
  public void start()
    getContentPane().setLayout(new BorderLayout());
    JButton b = new JButton("Do Nothing");
    getContentPane().add(b, BorderLayout.CENTER);

  public void update()

  public void actionPerformed(ActionEvent event)


      style="position:absolute; left:0; top:0; width:300; height:300; visibility:visible"

      <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">

	<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">


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

EVALUATION the fix causes a regression bug 6367496

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

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