• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to change third level sub menu item position?

 
ertan eyimaya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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....
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
thanks for your reply. I'll try it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic