JDK-4688783 : JPopupMenu hardcoded i JMenu
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.1,1.4.1
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_nt,windows_2000
  • CPU: x86
  • Submitted: 2002-05-21
  • Updated: 2017-05-23
Related Reports
Duplicate :  
Relates :  
Description
Name: gm110360			Date: 05/21/2002


FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]



A DESCRIPTION OF THE PROBLEM :
I have subclassed JPopupMenu and i would like to use it in
my rather large menu-trees. However, JMenu is hardcoded to
crate JPopupMenu's. The methods and jpopupMenu member is
private and it is therefore not possible to change this
behavior with subclassing.

JMenu should have the possibility to (in the constructor)
add a subclassed version of JPopupMenu instead. It should
at least be possible to overide the ensurePopupCreated()
method och member popupMenu.

This should not break backward compatibility and is very
easy to implement.


This bug can be reproduced always.

CUSTOMER WORKAROUND :
none that I know of
(Review ID: 138856) 
======================================================================

Comments
EVALUATION Contribution forum : https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?forumID=1463&messageID=16701
07-11-2006

EVALUATION Name: azR10139 Date: 04/25/2003 The hard-cofing of the JPopupMenu in JMenu is incorrect, but i don't think that we need a special constructor to deal with this. The good way is to collect all the functionality linked with the popup creation in the getPopupMenu() method to allow user to set his own PopupMenu's by extend the JMenu class and overriding of the getPopupMenu() method. ###@###.### 04/25/2003 ======================================================================
25-04-2003