FileDocCategorySizeDatePackage
MotifComboBoxRenderer.javaAPI DocJava SE 5 API2597Fri Aug 26 14:54:46 BST 2005com.sun.java.swing.plaf.motif

MotifComboBoxRenderer

public class MotifComboBoxRenderer extends JLabel implements Serializable, ListCellRenderer
Motif rendition of the combo box renderer.

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. A future release of Swing will provide support for long term persistence.

Fields Summary
protected static Border
noFocusBorder
Constructors Summary
public MotifComboBoxRenderer()


      
	super();
	setOpaque(true);
	setBorder(noFocusBorder);
    
Methods Summary
public java.awt.ComponentgetListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)


        setHorizontalAlignment(SwingConstants.LEFT);
        if (isSelected) {
            setBackground(list.getSelectionBackground());
            setForeground(list.getSelectionForeground());
        } else {
            setBackground(list.getBackground());
            setForeground(list.getForeground());
        }
	
	if (value instanceof Icon) {
	    setIcon((Icon)value);
	}
	else {
	    setText((value == null) ? "" : value.toString());
	}
	return this;