Browse Source

Fixed NPE when no TabFrameParent was set for PanelPopup.

Signed-off-by: weisj <weisj@arcor.de>
pull/15/head
weisj 5 years ago
parent
commit
d31a64c6e9
  1. 2
      src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java

2
src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java

@ -358,8 +358,10 @@ public class DarkPanelPopupUI extends DarkPanelUI implements PropertyChangeListe
if (focusOwner instanceof JTabFrame) return; if (focusOwner instanceof JTabFrame) return;
if (focusOwner instanceof JRootPane) return; if (focusOwner instanceof JRootPane) return;
boolean focus = DarkUIUtil.hasFocus(popupComponent); boolean focus = DarkUIUtil.hasFocus(popupComponent);
if (popupComponent.getTabFrame() != null) {
var container = popupComponent.getTabFrame().getContentPane().getContainer(popupComponent.getAlignment()); var container = popupComponent.getTabFrame().getContentPane().getContainer(popupComponent.getAlignment());
focus = focus || DarkUIUtil.hasFocus(container); focus = focus || DarkUIUtil.hasFocus(container);
}
setHeaderBackground(focus); setHeaderBackground(focus);
} }
} }

Loading…
Cancel
Save