Bug 678596

Summary: JMenu do not work anymore in JApplet (the menu does not open)
Product: [Fedora] Fedora Reporter: Marco Motta <marco.motta>
Component: java-1.6.0-openjdkAssignee: Denis Lila <dlila>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: ahughes, dbhole, dlila, jvanek, langel, lkundrak, mjw, mmatejov, omajid, silvioto
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 13:06:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Marco Motta 2011-02-18 15:04:03 UTC
Description of problem:


Version-Release number of selected component (if applicable):

java-1.6.0-openjdk.x86_64                1:1.6.0.0-52.1.9.7.fc14        @updates
java-1.6.0-openjdk-devel.x86_64          1:1.6.0.0-52.1.9.7.fc14        @updates
java-1.6.0-openjdk-javadoc.x86_64        1:1.6.0.0-52.1.9.7.fc14        @updates
java-1.6.0-openjdk-plugin.x86_64         1:1.6.0.0-52.1.9.7.fc14        @updates
java-1.6.0-openjdk-src.x86_64            1:1.6.0.0-52.1.9.7.fc14        @updates

How reproducible:

Write the files Menu.java and compile it; write the file applet.html; open it in a browser and click on the menu.

Steps to Reproduce:
1. Write the file Menu.java:
import javax.swing.*;

public class Menu extends JApplet
 {
  public void init()
   {
    JMenuBar jMenuBar=new JMenuBar();
    JMenu jMenu=new JMenu("Select");
    jMenuBar.add(jMenu);
    jMenu.add(new JMenuItem("1"));
    jMenu.add(new JMenuItem("2"));
    this.setJMenuBar(jMenuBar);
   }
 }
2. Compile Menu.java with
javac Menu.java
3. Write applet.html:
<html><body>

<applet width="350" height="30" code="Menu2.class" name="prova">

</applet>
</body></html>
4. From the same folder of the files, type on a terminal
firefox applet.html
(or open the file in a browser)
5) Click on "Select"
  
Actual results:
The menu do not opens, and it is reported the following exception:

Exception in thread "AWT-EventQueue-0" java.security.AccessControlException: access denied (java.awt.AWTPermission setWindowAlwaysOnTop)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
at java.security.AccessController.checkPermission(AccessController.java:553)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:250)
at java.awt.Window.setAlwaysOnTop(Window.java:2038)
at javax.swing.Popup$HeavyWeightWindow.(Popup.java:239)
at javax.swing.Popup.createComponent(Popup.java:211)
at javax.swing.Popup.reset(Popup.java:149)
at javax.swing.PopupFactory$HeavyWeightPopup.getHeavyWeightPopup(PopupFactory.java:337)
at javax.swing.PopupFactory.getHeavyWeightPopup(PopupFactory.java:267)
at javax.swing.PopupFactory.getPopup(PopupFactory.java:228)
at javax.swing.PopupFactory.getPopup(PopupFactory.java:173)
at javax.swing.plaf.PopupMenuUI.getPopup(PopupMenuUI.java:61)
at javax.swing.JPopupMenu.getPopup(JPopupMenu.java:795)
at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:748)
at javax.swing.JPopupMenu.show(JPopupMenu.java:921)
at javax.swing.JMenu.setPopupMenuVisible(JMenu.java:351)
at javax.swing.JPopupMenu.menuSelectionChanged(JPopupMenu.java:1433)
at javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager.java:117)
at javax.swing.plaf.basic.BasicMenuUI.appendPath(BasicMenuUI.java:223)
at javax.swing.plaf.basic.BasicMenuUI.access$200(BasicMenuUI.java:49)
at javax.swing.plaf.basic.BasicMenuUI$Handler.mousePressed(BasicMenuUI.java:463)
at java.awt.Component.processMouseEvent(Component.java:6200)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:5968)
at java.awt.Container.processEvent(Container.java:2105)
at java.awt.Component.dispatchEventImpl(Component.java:4564)
at java.awt.Container.dispatchEventImpl(Container.java:2163)
at java.awt.Component.dispatchEvent(Component.java:4390)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4461)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4122)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4055)
at java.awt.Container.dispatchEventImpl(Container.java:2149)
at java.awt.Component.dispatchEvent(Component.java:4390)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649)
at java.awt.EventQueue.access$000(EventQueue.java:96)
at java.awt.EventQueue$1.run(EventQueue.java:608)
at java.awt.EventQueue$1.run(EventQueue.java:606)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
at java.awt.EventQueue$2.run(EventQueue.java:622)
at java.awt.EventQueue$2.run(EventQueue.java:620)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:619)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

Expected results:

The menu opens
Additional info:
The reported applet works in Windows, in previous version of openjdk in my Fedora 14, and works if the applet is a signed applet.

Comment 1 Denis Lila 2011-02-18 17:07:35 UTC
I can confirm that this bug has been fixed in HEAD by the b21 release.

Comment 2 Andrew John Hughes 2011-02-19 00:03:35 UTC
Denis, do you know what patch fixes it? Is it some patch we apply to HEAD or something we upstreamed already?

Comment 3 Denis Lila 2011-02-22 14:40:52 UTC
@Andrew:
It's these changesets:
http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/dd66920b2d51
http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/40414219305f

They're not patches that we apply (yet). They were backported into openjdk6 and we got them in HEAD when we started using b21.

Comment 4 Andrew John Hughes 2011-02-22 22:57:07 UTC
Ok post a backport for 1.7, 1.8 and 1.9 to the list and I'll approve it.

Comment 5 SilvioTO 2011-02-23 20:40:16 UTC
Problems here too... I don't be able to open a pjirc applets.

java.security.AccessControlException : access denied

Comment 6 Denis Lila 2011-02-23 21:10:29 UTC
I just pushed the bug fixes. You should get them through yum with the next release.

Comment 7 Fedora End Of Life 2012-08-16 13:06:53 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping