KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > DefaultListCellRenderer


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: DefaultListCellRenderer.java,v $
11    Revision 1.1 2004/01/26 08:11:00 bobintetley
12    Many bugfixes and addition of SwingSet
13
14
15 */

16 package swingwtx.swing;
17
18 public class DefaultListCellRenderer extends swingwtx.swing.JLabel implements ListCellRenderer {
19     
20     public DefaultListCellRenderer() {
21         //setOpaque(true);
22
}
23      
24     public swingwt.awt.Component getListCellRendererComponent(JList list, Object JavaDoc value, int index, boolean isSelected, boolean cellHasFocus) {
25         String JavaDoc s = value.toString();
26         setText(s);
27         return this;
28      }
29  }
30
Popular Tags