1 package tim.prune.function.weather;
3 import java.awt.Component;
4 import java.awt.Dimension;
6 import javax.swing.JLabel;
7 import javax.swing.JTable;
8 import javax.swing.SwingConstants;
9 import javax.swing.table.TableCellRenderer;
11 import tim.prune.gui.IconManager;
14 * Class to render the weather icons in the table
16 public class IconRenderer extends JLabel implements TableCellRenderer
18 /** Get the renderer component for the given row, column and value */
19 public Component getTableCellRendererComponent(JTable inTable, Object inValue, boolean inIsSelected,
20 boolean inHasFocus, int inRow, int inColumn)
22 if (inValue != null) {
23 setIcon(IconManager.getImageIcon("weather-" + inValue.toString()));
24 setHorizontalAlignment(SwingConstants.CENTER);
33 /** Override the minimum size method */
34 public Dimension getMinimumSize() {
35 return new Dimension(52, 52);