equal
deleted
inserted
replaced
159 * <pre> |
159 * <pre> |
160 * {@code |
160 * {@code |
161 * // Display an icon and a string for each object in the list. |
161 * // Display an icon and a string for each object in the list. |
162 * |
162 * |
163 * class MyCellRenderer extends JLabel implements ListCellRenderer<Object> { |
163 * class MyCellRenderer extends JLabel implements ListCellRenderer<Object> { |
164 * final static ImageIcon longIcon = new ImageIcon("long.gif"); |
164 * static final ImageIcon longIcon = new ImageIcon("long.gif"); |
165 * final static ImageIcon shortIcon = new ImageIcon("short.gif"); |
165 * static final ImageIcon shortIcon = new ImageIcon("short.gif"); |
166 * |
166 * |
167 * // This is the only method defined by ListCellRenderer. |
167 * // This is the only method defined by ListCellRenderer. |
168 * // We just reconfigure the JLabel each time we're called. |
168 * // We just reconfigure the JLabel each time we're called. |
169 * |
169 * |
170 * public Component getListCellRendererComponent( |
170 * public Component getListCellRendererComponent( |