🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8886

JPopupMenu - lightweight / heavyweight modes

#8886
From: Stephan Klaffer
Date: Tue, 11 Jul 2000 00:00
35 lines
1874 bytes
Hello,

I have an application which mainly uses SWING. Unfortunately I also have to
use an older AWT control. I figured out that I have to use the
"setLightWeightPopupEnabled(false)" property to show the popup over the AWT
control. But now the submenus are not visible - they do not pop up at all.
Here is the code that I am using to build the popup menu.

JPopupMenu cMenu = new JPopupMenu();
JMenu cSubMenu = new JMenu("SubMenu 1");

cMenu.add("Item1");
cSubMenu.add("SubItem1");
cSubMenu.add("SubItem2");
cMenu.add(cSubMenu);

Then I am showing this created menu with

cMenu.show(cParent, iXPos, iYPos);

So far it works fine if I am only using SWING components. Now, in order to
support the older AWT control I have to state the
"setLightWeightPopupEnabled(false)" property. This still works fine with the
main popup menu, but all the sub menu items simply do not appear if :
# the main popup window fits completely into the application window
# the sub menu would fit completely into the application window

If one of these conditions is false, then the popup will appear.


Does anybody know what I am making wrong?

Thanks a lot in advance,

Stephan
Technical Details
Message-ID: <963317167.17991.0.nnrp-10.c29f1f7c@news.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9a219a5384cb918c,start
X-Google-Attributes: gid111d45,public
From: "Stephan Klaffer" <stephan.klaffer@decisionworks.co.uk>
Subject: JPopupMenu - lightweight / heavyweight modes
Date: 2000/07/11
Message-ID: <963317167.17991.0.nnrp-10.c29f1f7c@news.demon.co.uk>
X-Deja-AN: 645002193
X-NNTP-Posting-Host: [194.159.31.124]:194.159.31.124
X-Trace: news.demon.co.uk 963317167 nnrp-10:17991 NO-IDENT [194.159.31.124]:194.159.31.124
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Newsgroups: borland.public.jbuilder.java.swing
X-Complaints-To: abuse@demon.net