mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 16:25:10 +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;
|
mouseX = mouseLocation.x;
|
||||||
mouseY = mouseLocation.y;
|
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];
|
JPopupMenu popup = (JPopupMenu) path[subMenuIndex];
|
||||||
|
if( !popup.isShowing() ) {
|
||||||
|
uninstallEventQueue();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get invoker screen bounds
|
||||||
Component invoker = popup.getInvoker();
|
Component invoker = popup.getInvoker();
|
||||||
invokerBounds = (invoker != null)
|
invokerBounds = (invoker != null)
|
||||||
? new Rectangle( invoker.getLocationOnScreen(), invoker.getSize() )
|
? new Rectangle( invoker.getLocationOnScreen(), invoker.getSize() )
|
||||||
|
|||||||
Reference in New Issue
Block a user