mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 08:15:09 +03:00
Menus: fixed IllegalComponentStateException: component must be showing on the screen to determine its location when submenu is empty (PR #490; issue #247)
This commit is contained in:
@@ -130,8 +130,14 @@ debug*/
|
||||
mouseX = mouseLocation.x;
|
||||
mouseY = mouseLocation.y;
|
||||
|
||||
// get invoker screen bounds
|
||||
// check whether popup is showing, which is e.g. not the case if it is empty
|
||||
JPopupMenu popup = (JPopupMenu) path[subMenuIndex];
|
||||
if( !popup.isShowing() ) {
|
||||
uninstallEventQueue();
|
||||
return;
|
||||
}
|
||||
|
||||
// get invoker screen bounds
|
||||
Component invoker = popup.getInvoker();
|
||||
invokerBounds = (invoker != null)
|
||||
? new Rectangle( invoker.getLocationOnScreen(), invoker.getSize() )
|
||||
|
||||
Reference in New Issue
Block a user