Nimbus-compatible getting of list selection background and foreground [r=max]

This commit is contained in:
Dmitry Jemerov
2008-10-29 18:04:32 +03:00
parent 7ca4a6504d
commit 3e8d3e2b17
+10 -2
View File
@@ -185,7 +185,11 @@ public class UIUtil {
}
public static Color getListSelectionForeground() {
return UIManager.getColor("List.selectionForeground");
final Color color = UIManager.getColor("List.selectionForeground");
if (color == null) {
return UIManager.getColor("List[Selected].textForeground"); // Nimbus
}
return color;
}
public static Color getFieldForegroundColor() {
@@ -317,7 +321,11 @@ public class UIUtil {
}
public static Color getListSelectionBackground() {
return UIManager.getColor("List.selectionBackground");
final Color color = UIManager.getColor("List.selectionBackground");
if (color == null) {
return UIManager.getColor("List[Selected].textBackground"); // Nimbus
}
return color;
}
public static Color getTextFieldForeground() {