Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / June 2005

Tip: Looking for answers? Try searching our database.

PopupMenu on a JMenuItem

Thread view: 
wardleJW - 22 Jun 2005 00:19 GMT
Is it possible to hava a PopupMenu on a JMenuItem ?

I have been able to capture right click events and create the
PopupMenu, but I have the following problem: The Menu containing the
MenuItem dissappears.  I need to keep the Menu and selected MenuItem in
view.  The PopupMenu's items are going to be related to the selected
MenuItem.

thank's for help
Larry Barowski - 22 Jun 2005 03:39 GMT
> Is it possible to hava a PopupMenu on a JMenuItem ?
>
[quoted text clipped - 3 lines]
> view.  The PopupMenu's items are going to be related to the selected
> MenuItem.

This will be look-and-feel dependent. You might get it to work
for one or more L&Fs, but not in general. I'm guessing it can't
work on a Mac with Mac L&F and the screen menu bar turned
on.

Why do you want to do this? This is non-standard gui behavior.
Maybe you can find another approach.
Axel.Hallez - 22 Jun 2005 08:33 GMT
> Is it possible to hava a PopupMenu on a JMenuItem ?
>
[quoted text clipped - 5 lines]
>
> thank's for help

I could be wrong, but I think that submenu's are what you need here. You
have to create the submenu as a JMenu and add it to the parent JMenu
just like any other menu item.
For an example see:
http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html

Hope this helps,
Axel Hallez


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.