My application uses wrong colors for JList since I updated to the latest Java 8 version (U20). E.g. instead of dark blue for selected items a light gray is actually used.
Simple test application:
import javax.swing.DefaultListModel;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;
public class Test {
public Test() {
try {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
JList<String> l = new JList<>();
DefaultListModel<String> model = new DefaultListModel<>();
model.add(0, "sssssssss");
model.add(1, "sssssssss");
model.add(2, "sssssssss");
model.add(3, "sssssssss");
l.setModel(model);
JFrame f = new JFrame();
f.setSize(500, 500);
f.setLocationRelativeTo(null);
f.add(l);
f.pack();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setVisible(true);
}
catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new Test();
}
});
}
}
Java 7, Java 8
Java 8 U20:
JList.getSelectionBackground()
returns
DerivedColor(color=57,105,138 parent=nimbusSelectionBackground offsets=0.0,0.0,0.0,0 pColor=57,105,138
but actually it is not RGB(57,105,138) but the above mentioned light gray.