JDK-6617411 : Incorrect position of submenu of popup menu when submenu should be placed on left side of popup menu
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u3
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-10-16
  • Updated: 2010-04-02
  • Resolved: 2007-10-16
Related Reports
Duplicate :  
Description
If items are added to submenu in method popupMenuWillBecomeVisible of PopupMenuListener position of submenu is incorrect when submenu is displayed on left side of parent menu ie. when there is not enough space on right side. It looks like submenu position is computed BEFORE event is fired. We use this way to populate submeanu lazily to speed up showing of main popup menu. Small app to demonstrate this behavior is attached. Maximize app window and invoke popup menu on right side of maximized window. Invoke submenu and you will see - submenu is placed over popup menu instead of on left side of popup menu.

It is reproducible on Linux, Window, JDK 6u3, 7b21. Is there any workaround or another way how to populate submenu lazily?