Color (AbstractButton button) { Color focusedColor = (Color)button.getClientProperty("JButton.focusedTextColor"); Color textColor = (Color)button.getClientProperty("JButton.textColor"); boolean focusedStyle = button.hasFocus() || button.getModel().isRollover(); if (focusedStyle && focusedColor != null) { return focusedColor; } else if (!focusedStyle && textColor != null) { return textColor; } else { return DarculaUIUtil.getButtonTextColor(button); } }