does the two methods in ListCellRenderer works as ActionListener?
Hi, I read the API about listcellrenderer again and again, still doesn't know why we need
the two methods
Component getListCellRendererComponent(List list, java.lang.Object value, int index, boolean isSelected)
Returns a component instance that is already set to render "value".
Component getListFocusComponent(List list)
Rreturns a component instance that paints the list focus item.
If I use a cellrenderer in a list, is it necessary to call these two methods?
is getListCellRendererComponent just to set the cell value of the list?
then what is the parameter of the object value? I need set it by myself, or it works like a actionListener, the value can be automatically got.
getListFocusComponent seems that if I select an item , then it will repaint the part I chose...am I right?
I read the examples in demo--scroll and Renderer, It seems both two the cell value is
given when the Renderer class is created by new Renderer(), right?
is there a way to give the value to display in the cell of list after already have the renderer reference, such as
Renderer renderer=new Renderer();
is it possible?
Looking forward to your replies, thank you .