diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java index 2776e598..caa0d1a7 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tooltip/DarkTooltipUI.java @@ -98,6 +98,11 @@ public class DarkTooltipUI extends BasicToolTipUI implements PropertyChangeListe exitListener.mouseExited(e); } }; + protected PropertyChangeListener componentPropertyChaneListener = e -> { + if (KEY_STYLE.equals(e.getPropertyName())) { + updateStyle(); + } + }; public static ComponentUI createUI(final JComponent c) { @@ -272,10 +277,12 @@ public class DarkTooltipUI extends BasicToolTipUI implements PropertyChangeListe Object oldComp = evt.getOldValue(); if (oldComp instanceof Component) { ((Component) oldComp).removeMouseListener(mouseListener); + ((Component) oldComp).removePropertyChangeListener(componentPropertyChaneListener); } Object newComp = evt.getNewValue(); if (newComp instanceof Component) { ((Component) newComp).addMouseListener(mouseListener); + ((Component) newComp).addPropertyChangeListener(componentPropertyChaneListener); } updateStyle(); } else if (TIP_TEXT_PROPERTY.equals(key)) {