1 package sk.stuba.fiit.foo07.genex.gui; 2 3 import java.awt.Component; 4 5 import javax.swing.ImageIcon; 6 import javax.swing.JTable; 7 import javax.swing.table.TableCellRenderer; 8 9 public class IconCellRenderer implements TableCellRenderer { 10 11 private IconComponent component; 12 13 public IconCellRenderer() { 14 component = new IconComponent(); 15 } 16 17 public Component getTableCellRendererComponent(JTable table, Object value, 18 boolean isSelected, boolean hasFocus, int row, int column) { 19 component.setIcon((ImageIcon) value); 20 21 return component; 22 } 23 }