Font f = getFont(); FontMetrics fm = getFontMetrics(f);
Font f = this.getFont(); FontMetrics fm = this.getFontMetrics(f);
    public Component getListCellRendererComponent(final JList list,						  final Object value,						  final int index,						  final boolean isSelected,						  final boolean cellHasFocus) {      try {	final PropertyEditor e = (PropertyEditor)m_EditorClass.newInstance();	if (e instanceof GenericObjectEditor) {	  //	  ((GenericObjectEditor) e).setDisplayOnly(true);	  ((GenericObjectEditor) e).setClassType(m_ValueClass);	}	e.setValue(value);	return new JPanel() {	  public void paintComponent(Graphics g) {	    Insets i = getInsets();	    Rectangle box = new Rectangle(i.left, i.top,					  getWidth() - i.right,					  getHeight() - i.bottom );	    g.setColor(isSelected		       ? list.getSelectionBackground()		       : list.getBackground());	    g.fillRect(0, 0, getWidth(), getHeight());	    g.setColor(isSelected		       ? list.getSelectionForeground()		       : list.getForeground());	    e.paintValue(g, box);	  }	  	  public Dimension getPreferredSize() {	    Font f = getFont();	    FontMetrics fm = getFontMetrics(f);	    return new Dimension(0, fm.getHeight());	  }	};      } catch (Exception ex) {	return null;      }    }