javax.swing

Class DefaultListCellRenderer

public class DefaultListCellRenderer extends JLabel implements ListCellRenderer, Serializable

The default implementation {@link ListCellRenderer}. It provides a standard renderer for data objects of all types via {@link Object#toString()}.
Nested Class Summary
static classDefaultListCellRenderer.UIResource
Subclasses DefaultListCellRenderers and implements {@link javax.swing.plaf.UIResource}.
Field Summary
protected static BordernoFocusBorder
This border is used whenever renderer doesn't have a focus.
Method Summary
protected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)
voidfirePropertyChange(String propertyName, byte oldValue, byte newValue)
voidfirePropertyChange(String propertyName, char oldValue, char newValue)
voidfirePropertyChange(String propertyName, short oldValue, short newValue)
voidfirePropertyChange(String propertyName, int oldValue, int newValue)
voidfirePropertyChange(String propertyName, long oldValue, long newValue)
voidfirePropertyChange(String propertyName, float oldValue, float newValue)
voidfirePropertyChange(String propertyName, double oldValue, double newValue)
voidfirePropertyChange(String propertyName, boolean oldValue, boolean newValue)
ComponentgetListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
getListCellRendererComponent
voidrepaint(long tm, int x, int y, int w, int h)
voidrepaint(Rectangle rect)
voidrevalidate()
voidvalidate()

Field Detail

noFocusBorder

protected static Border noFocusBorder
This border is used whenever renderer doesn't have a focus.

Method Detail

firePropertyChange

protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)

firePropertyChange

public void firePropertyChange(String propertyName, byte oldValue, byte newValue)

firePropertyChange

public void firePropertyChange(String propertyName, char oldValue, char newValue)

firePropertyChange

public void firePropertyChange(String propertyName, short oldValue, short newValue)

firePropertyChange

public void firePropertyChange(String propertyName, int oldValue, int newValue)

firePropertyChange

public void firePropertyChange(String propertyName, long oldValue, long newValue)

firePropertyChange

public void firePropertyChange(String propertyName, float oldValue, float newValue)

firePropertyChange

public void firePropertyChange(String propertyName, double oldValue, double newValue)

firePropertyChange

public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)

getListCellRendererComponent

public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
getListCellRendererComponent

Parameters: list JList list for the 'value' value object that should be rendered in the cell index index of the cell isSelected draw cell highlighted if isSelected is true cellHasFocus draw focus rectangle around cell if the cell has focus

Returns: Component that will be painted to the desired cell.

repaint

public void repaint(long tm, int x, int y, int w, int h)

repaint

public void repaint(Rectangle rect)

revalidate

public void revalidate()

validate

public void validate()