public class javax.swing
DefaultListCellRenderer


Hide details Login
Java SE 6
  
Extends: Component > Container > JComponent > JLabel
Implements: ListCellRenderer, Serializable
Inner classes: DefaultListCellRenderer.UIResource
Extended by: DefaultListCellRenderer.UIResource, MetalFileChooserUI.FileRenderer, MetalFileChooserUI.FilterComboBoxRenderer

Renders an item in a list.

Implementation Note: This class overrides invalidate, validate, revalidate, repaint, isOpaque, and firePropertyChange solely to improve performance. If not overridden, these frequently called methods would execute code paths that are unnecessary for the default list cell renderer. If you write your own renderer, take care to weigh the benefits and drawbacks of overriding these methods.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder.
version1.32 11/30/05


Fields
protected static Border noFocusBorder
An empty Border. This field might not be used. To change the Border used by this renderer override the getListCellRendererComponent method and set the border of the returned component directly.

Constructors
public DefaultListCellRenderer()
Constructs a default renderer object for an item in a list.

Methods
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, byte oldValue, byte newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, char oldValue, char newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, short oldValue, short newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, int oldValue, int newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, long oldValue, long newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, float oldValue, float newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, double oldValue, double newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
Overridden for performance reasons. See the Implementation Note for more information.
public void invalidate()
Overridden for performance reasons. See the Implementation Note for more information.
since1.5
public void repaint()
Overridden for performance reasons. See the Implementation Note for more information.
since1.5
public void repaint(long tm, int x, int y, int width, int height)
Overridden for performance reasons. See the Implementation Note for more information.
public void repaint(Rectangle r)
Overridden for performance reasons. See the Implementation Note for more information.
public void revalidate()
Overridden for performance reasons. See the Implementation Note for more information.
public void validate()
Overridden for performance reasons. See the Implementation Note for more information.

Properties
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
public boolean isOpaque()
Overridden for performance reasons. See the Implementation Note for more information.
since1.5
returntrue if the background is completely opaque and differs from the JList's background; false otherwise