JDK-6618543 : Applet window is not made top window immediately after applet invocation
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 5.0u12
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-10-18
  • Updated: 2014-04-15
  • Resolved: 2014-04-15
Related Reports
Relates :  
Relates :  
Description
Applet window is not made top window after applet invocation. 
This behaviour was observed on Windows XP Professional SP2.
Did not try Solaris.

The problem is easily reproducible.

1. testcase
-----------
% more FrameTest.java

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

public class FrameTest extends Applet {
  public void init() {
    System.out.println("Inside init");
    createFrame();
  }
  public void start(){
    System.out.println("FrameTest started");
  }
  public void stop(){
    System.out.println("FrameTest Stopped");
  }
  private void createFrame() {
    JFrame f = new JFrame();
    f.setBounds(getBounds());
    f.getContentPane().add(new Label("Hello World"),BorderLayout.CENTER);
    f.setTitle("Hello World");
    f.setVisible(true);
  }
  public void paint(Graphics g) {
  }
} 

% more FrameHtml.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> New Document </TITLE>
   <META NAME="Generator" CONTENT="EditPlus">
   <META NAME="Author" CONTENT="">
   <META NAME="Keywords" CONTENT="">
   <META NAME="Description" CONTENT="">
 </HEAD>
 <BODY>
  <applet code = "FrameTest.class" width='300' height='300'>
  </applet>
 </BODY>
</HTML>

2. Compile applet w/ 1.5.0_12
3. Launch Applet in either IE 6 (Win XP Prof. SP2) or Firefox 1.5.0.12
   The applet window immediately after applet startup goes behind the 
   browser window and then hidden. 

4. Compare applet behaviour w/ when compiled with 1.4.2_15.
   The applet window stay on the top and is not hidden by the browser window.