public class QListCellRenderer
extends java.lang.Object
implements javax.swing.ListCellRenderer
ListCellRenderer
for customizing JList
rendering. The foreground color and icons used can be
customized using the strategy design pattern. Borders and selection bars are fixed. This class can be shared among
JLists.Constructor and Description |
---|
QListCellRenderer()
Default constructor with
NoColorFactory and NoIconFactory . |
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
getListCellRendererComponent(javax.swing.JList list,
java.lang.Object value,
int index,
boolean isSelected,
boolean cellHasFocus) |
void |
setForegroundFactory(ColorFactory factory)
Replace the strategy for determining the text color.
|
void |
setIconFactory(IconFactory factory)
Replace the strategy for determining the icon.
|
public QListCellRenderer()
NoColorFactory
and NoIconFactory
.public void setForegroundFactory(ColorFactory factory)
public void setIconFactory(IconFactory factory)
public java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
getListCellRendererComponent
in interface javax.swing.ListCellRenderer