From f51aa03648f8d86fd2e369451e8b143655e8b90e Mon Sep 17 00:00:00 2001 From: weisj Date: Wed, 18 Mar 2020 19:47:43 +0100 Subject: [PATCH] Fix java 8 incompatible code. --- .../com/github/weisj/darklaf/ui/DarkPopupFactory.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java b/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java index b5f48ed0..104175dd 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java @@ -31,14 +31,16 @@ import javax.swing.*; import java.awt.*; public class DarkPopupFactory extends PopupFactory { + @Override - protected Popup getPopup(final Component owner, final Component contents, - final int x, final int y, final boolean heavyWeight) throws IllegalArgumentException { - Popup popup = super.getPopup(owner, contents, x, y, heavyWeight); + public Popup getPopup(final Component owner, final Component contents, + final int x, final int y) throws IllegalArgumentException { + Popup popup = super.getPopup(owner, contents, x, y); if (popup.getClass().getSimpleName().endsWith("MediumWeightPopup")) { if (contents instanceof JToolTip && ((JToolTip) contents).getBorder() instanceof DarkTooltipBorder) { - popup = super.getPopup(owner, contents, x, y, true); + // null owner forces a heavyweight popup. + popup = super.getPopup(null, contents, x, y); } else { JRootPane rootPane = SwingUtilities.getRootPane(contents); // Prevents decorations from being reinstalled.