JDK-5085647 : Possible to create an applet window with no applet warning
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0,6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,solaris_2.5.1
  • CPU: generic,x86
  • Submitted: 2004-08-11
  • Updated: 2005-07-23
  • Resolved: 2005-07-23
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
5.0u8Fixed 6 b45Fixed
Related Reports
Duplicate :  
Description
Name: rmT116609			Date: 08/11/2004


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


ADDITIONAL OS VERSION INFORMATION :
Linux jupiter 2.6.3-7mdk #1 Wed Mar 17 15:56:42 CET 2004 i686 unknown unknown GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
Mandrake Linux 10.0, KDE

A DESCRIPTION OF THE PROBLEM :
A simple JWindow is displayed with no applet warning when run as an unsigned applet.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached code.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A window with an applet warning should be displayed.
ACTUAL -
A window with no applet warning is displayed. Additionally, not the entire contents of the window is painted red, as it should be. 

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Java source code:

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

public class WindowApplet extends Applet{
  
  
  public void start(){
    JFrame f = new JFrame("Test Frame");
    f.setBounds(50, 50, 100, 100);
    f.setVisible(true);
    
    JWindow window = new JWindow(f);

    JPanel panel = new JPanel();
    panel.setOpaque(true);
    panel.setBackground(Color.red);
    window.setContentPane(panel);
    window.setBounds(50, 50, 500, 500);
    window.setVisible(true);
    window.toFront();
  }
  
}
---------- END SOURCE ----------
(Incident Review ID: 296558) 
======================================================================
###@###.### 2004-08-11

Comments
SUGGESTED FIX Essentially, six lines added. ------- XWindowPeer.java ------- *** /tmp/sccs.AvnHNt 2005-07-11 17:19:36.660816075 +0400 --- XWindowPeer.java 2005-07-11 17:17:56.222542497 +0400 *************** *** 212,217 **** --- 212,218 ---- } public Insets getInsets() { + insets.top += getWarningWindowHeight(); return insets; } *************** *** 415,420 **** --- 416,423 ---- // there could be a race condition in which a ComponentListener could // see the old screen. super.handleConfigureNotifyEvent(ptr); + // for 5085647: no applet warning window visible + updateChildrenSizes(); } final void requestXFocus(long time) { *************** *** 666,671 **** --- 669,681 ---- updateFocusability(); promoteDefaultPosition(); super.setVisible(vis); + // method called somewhere in parent does not generate configure-notify + // event for override-redirect. + // Ergo, no reshape and bugs like 5085647 in case setBounds was + // called before setVisible. + if( isOverrideRedirect() ) { + updateChildrenSizes(); + } } boolean isSimpleWindow() { ###@###.### 2005-07-11 13:27:19 GMT
11-07-2005

EVALUATION The duplicate of 5085648 ###@###.### 2004-08-12 We should properly update children sizes in XWindowPeer. There's two places to update: first, immediately after mapping window; second, upon a configure request. For some reason XWindowPeer does handle configure notify even if this peer is override-redirect. ###@###.### 2005-07-11 13:27:19 GMT
11-07-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
14-08-2004