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