public interface IlxWListCellRenderer
class MyCellRenderer extends IlxWLabel implements IlxWListCellRenderer {
public IlxWComponent getListCellRendererComponent(
IlxWList list,
Object value,
int index,
boolean isSelected)
{
setText(value.toString());
if (isSelected) {
getStyle().set("backgroundColor", "red");
getStyle().set("color", "white");
} else {
getStyle().set("backgroundColor", "white");
getStyle().set("color", "black");
}
return this;
}
}
| Modifier and Type | Method and Description |
|---|---|
IlxWComponent |
getListCellRendererComponent(IlxWList list,
java.lang.Object value,
int index,
boolean isSelected)
Return a component that has been configured to display the specified
value.
|
IlxWComponent getListCellRendererComponent(IlxWList list, java.lang.Object value, int index, boolean isSelected)
print method is then called
to "render" the cell.list - The IlxWList we want to render.value - The value returned by list.getModel().getElementAt(index).index - The cells index.isSelected - True if the specified cell was selected.IlxWList,
ListSelectionModel,
ListModel© Copyright IBM Corp. 1987, 2017