TabbedPane: custom TabbedPane.selectedForeground color did not work when TabbedPane.foreground has also custom color (issue #257)

This commit is contained in:
Karl Tauber
2021-02-11 12:04:36 +01:00
parent 140ebfdb92
commit b5fc07acc7
2 changed files with 9 additions and 1 deletions

View File

@@ -893,7 +893,7 @@ public class FlatTabbedPaneUI
Color color;
if( tabPane.isEnabled() && tabPane.isEnabledAt( tabIndex ) ) {
color = tabPane.getForegroundAt( tabIndex );
if( isSelected && (color instanceof UIResource) && selectedForeground != null )
if( isSelected && selectedForeground != null && color == tabPane.getForeground() )
color = selectedForeground;
} else
color = disabledForeground;