From 3520a0f1fb338db7c627d95ddba6ce6368c4064e Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 30 Jan 2021 01:06:03 +0100 Subject: [PATCH] TextComponents: border of focused non-editable text components had wrong color --- CHANGELOG.md | 2 ++ .../src/main/java/com/formdev/flatlaf/ui/FlatBorder.java | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97542acf..f04f6a34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ FlatLaf Change Log color is different to default background color, even if component is not opaque (which is the default). This paints selection if using the component as cell renderer a Table, Tree or List. +- TextComponents: Border of focused non-editable text components had wrong + color. - Custom window decorations: Fixed top window border in dark themes when running in JetBrains Runtime. diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java index c435aed4..fe7504d7 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatBorder.java @@ -35,7 +35,6 @@ import javax.swing.JViewport; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.plaf.basic.BasicBorders; -import javax.swing.text.JTextComponent; import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.util.DerivedColor; @@ -159,7 +158,7 @@ public class FlatBorder return false; } - return c.isEnabled() && (!(c instanceof JTextComponent) || ((JTextComponent)c).isEditable()); + return c.isEnabled(); } protected boolean isFocused( Component c ) {