From fbb9bf5f0ce91dec000915144b9f9fe6ea0d40ac Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Sat, 16 May 2020 12:29:35 +0200 Subject: [PATCH] Extras: TriStateCheckBox: fixed painting third state in LaFs that do not support third state --- .../java/com/formdev/flatlaf/extras/TriStateCheckBox.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java index dd4871e9..4a9d28d2 100644 --- a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/TriStateCheckBox.java @@ -32,7 +32,7 @@ import com.formdev.flatlaf.FlatLaf; * value {@code "indeterminate"}. *

* FlatLaf and Mac Aqua LaF support the third state. - * For other LaFs a magenta rectangle is painted around the component. + * For other LaFs a magenta rectangle is painted around the component for the third state. * * @author Karl Tauber */ @@ -115,7 +115,7 @@ public class TriStateCheckBox protected void paintComponent( Graphics g ) { super.paintComponent( g ); - if( !isThirdStateSupported() ) { + if( state == State.INDETERMINATE && !isThirdStateSupported() ) { g.setColor( Color.magenta ); g.drawRect( 0, 0, getWidth() - 1, getHeight() - 1 ); }