JDK-5062061 : REGRESSION: New Frames wrongly display behind browser window
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2004-06-11
  • Updated: 2004-06-11
  • Resolved: 2004-06-11
Related Reports
Duplicate :  
Description
Name: gm110360			Date: 06/11/2004


FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows 2000 Professional 5.00.2195 SP4

EXTRA RELEVANT SYSTEM CONFIGURATION :
Internet Explorer 6.0.2800.1106 with all patches to 2004-06-06, Q831167
Netscape 7.01  Gecko/20021120


A DESCRIPTION OF THE PROBLEM :
Some new windows created by an applet are shown behind the browser window, where they cannot be seen by the user.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and load the test case code using minimal HTML, using either Internet Explorer or Netscape.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
All new windows should be on top of the browser window.
ACTUAL -
Frames shown from the init method all appear behind the browser window.

Frames shown from a secondary thread seem to be timing-dependent.  On my system the first one is always behind and the second and third usually on top.  On one occasion however the second one was also behind and only the third on top.  Injecting a 5 second delay ahead of the first causes all three to always be on top.

Frames shown from the first call to the applet paint method are all correctly on top.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
//
// ObsPup.java
// Simple obscured popup window tester
// Displays popup windows straddling top border of browser window
// JRE 1.5.0 beta 2 leaves some popups obscured behind the browser window
//
// All windows shown from init() are obscured
// One or two windows shown quickly from a secondary thread are obscured, later ones are on top
// All windows shown from the initial paint() are on top
//
// For simplicity of code, there is no window destroy logic,
// and settings are hard-coded (with comments) not taken from applet parameters
//

import java.applet.*;
import java.awt.*;

//************************** Main Applet Class
public class ObsPup
extends java.applet.Applet
{

private Point basePoint;
private boolean paintDone=false;
private int groupSeparation=200; // adjust as needed to stay within browser width

public void init() {
    basePoint=getParent().getLocationOnScreen();
    (new Popups("init",basePoint,0)).showPopups();
    (new Thread(new Popups("secondary",basePoint,groupSeparation))).start();
    }

public void paint(Graphics gra) {
    if(!paintDone) {
        (new Popups("paint",basePoint,2*groupSeparation)).showPopups();
        paintDone=true;
        }
    }

//************************** Popup Generation
static class Popups
implements Runnable
{
private String group;
private Point base;
private int offset;

Popups(String grp, Point bas, int ofs) {
    group=grp;
    base=bas;
    offset=ofs;
    }

public void run() {
    // with delay, all windows are on top; without, one or two are obscured
    // try { Thread.sleep(5000); } catch(InterruptedException e) {;}
    showPopups();
    }

public void showPopups() {
    // adjust values as needed to overlap top of browser window
    new PopupFrame(group, 1, base.x+offset,     base.y-160);
    new PopupFrame(group, 2, base.x+offset+60,  base.y-160);
    new PopupFrame(group, 3, base.x+offset+120, base.y-160);
    }

} // Popups

//************************** Individual Popup Frame
static class PopupFrame
extends java.awt.Frame
{

PopupFrame(String grp, int nbr, int x, int y) {
    super(grp+" "+nbr);
    setLayout(new FlowLayout());
    add(new Label(grp+" "+nbr));
    pack();
    setLocation(x,y);
    show();
    }

} // PopupFrame

} // ObsPup


---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Nothing attempted.

Classified as maximum severity because existing applets in the field become effectively unusable, with their windows not appearing.

Release Regression From : 1.4.2
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Incident Review ID: 276798) 
======================================================================

Comments
EVALUATION It is a duplicate of 4984794. The same focus issue. ###@###.### 2004-06-11
11-06-2004