I finaly customized selection colors at JList a JComboBoxes at my JFileChooser using this method that Eng. Fouad suggested here
public void customizeJFileChooser(Container c)
{
Component[] cmps = c.getComponents();
for (Component cmp : cmps)
{
if (cmp instanceof JList)
{
((JList)cmp).setSelectionBackground(new Color(164,164,164));
}
if (cmp instanceof JComboBox)
{
((JComboBox)cmp).setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
Component comp = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (isSelected)
comp.setBackground(new Color(164,164,164));
return comp;
}
});
}
if (cmp instanceof Container)
{
customizeJFileChooser((Container) cmp);
}
}
}
works great for the colors but... now I have a problem with the FileFilter names, as you can see above:
If I don't call the customizeJFileChooser it gets the names right, so it must be a problem with that method. Any help?