• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to change third level sub menu item position?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a popup menu up to four level. Let's say : Aaaaaaa->Bbbbbbb->Ccccccc->Ddddddd

When mouse is right clicked at right bottom of the screen Popup menu is shown. If I move mouse on Aaaaaaa since no place for second level,
Bbbbbbb is shown at left of Aaaaaaa, then if I move mouse on Bbbbbbb then Ccccccc appears at right of Bbbbbbb. Problem is here,
I want Ccccccc is displayed left of Bbbbbbb and Ddddddd is at left of Ccccccc. All sub menus should opened towards left.

Note: This of course should be reverse when I right click at left bottom of screen. This time I want all submenus will be opened at right of it's parent.

thanks....
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The behavior you describe is the default behavior of submenus on pretty much all windowed systems. You can find the code that computes the desired screen location in the method getPopupMenuOrigin() of JMenu.java.

If this is important enough to you, you could try extending JMenu to obtain the desired behavior. Won't be easy though -- that method is 120 lines long.
 
ertan eyimaya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your reply. I'll try it.
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic