uic.widgets
Class TwoColorListCellRenderer

java.lang.Object
  extended byuic.widgets.TwoColorListCellRenderer
All Implemented Interfaces:
ListCellRenderer

public class TwoColorListCellRenderer
extends Object
implements ListCellRenderer

CellRenderer for the list Has to different colors for the odd and even rows to improve the look


Constructor Summary
TwoColorListCellRenderer()
          Default constructor, same as new TwoColorListCellRenderer(null)
TwoColorListCellRenderer(ListCellRenderer renderer)
          Constructor based on an exisint cellrenderer
 
Method Summary
 Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
          Return the tweaked list cell renderer component
 boolean isPaintFocus()
           
 void setEvenRowColor(Color bg2)
          Set the even row color
 void setOddRowColor(Color bg)
          Set the odd row color
 void setPaintFocus(boolean paintFocus)
          Paint the focus if true
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoColorListCellRenderer

public TwoColorListCellRenderer()
Default constructor, same as new TwoColorListCellRenderer(null)


TwoColorListCellRenderer

public TwoColorListCellRenderer(ListCellRenderer renderer)
Constructor based on an exisint cellrenderer

Parameters:
renderer - a cellrenderer that needs to be used for displaying listentries, or null if DefaultListCellRenderer can be used
Method Detail

getListCellRendererComponent

public Component getListCellRendererComponent(JList list,
                                              Object value,
                                              int index,
                                              boolean isSelected,
                                              boolean cellHasFocus)
Return the tweaked list cell renderer component

Specified by:
getListCellRendererComponent in interface ListCellRenderer

setOddRowColor

public void setOddRowColor(Color bg)
Set the odd row color


setEvenRowColor

public void setEvenRowColor(Color bg2)
Set the even row color


setPaintFocus

public void setPaintFocus(boolean paintFocus)
Paint the focus if true


isPaintFocus

public boolean isPaintFocus()


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence