public java.awt.Component | getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
/**if (isSelected) {
setBackground(UIManager.getColor("ComboBox.selectionBackground"));
setForeground(UIManager.getColor("ComboBox.selectionForeground"));
} else {
setBackground(UIManager.getColor("ComboBox.background"));
setForeground(UIManager.getColor("ComboBox.foreground"));
}**/
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
setFont(list.getFont());
if (value instanceof Icon) {
setIcon((Icon)value);
}
else {
setText((value == null) ? "" : value.toString());
}
return this;
|