Extras: TriStateCheckBox: fixed painting third state in LaFs that do not support third state

This commit is contained in:
Karl Tauber
2020-05-16 12:29:35 +02:00
parent f632c355e8
commit fbb9bf5f0c

View File

@@ -32,7 +32,7 @@ import com.formdev.flatlaf.FlatLaf;
* value {@code "indeterminate"}.
* <p>
* 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 );
}