1 19 20 package org.netbeans.modules.tasklist.suggestions.ui; 21 22 import java.awt.Component ; 23 import javax.swing.ImageIcon ; 24 import javax.swing.JTable ; 25 import javax.swing.table.DefaultTableCellRenderer ; 26 import org.netbeans.modules.tasklist.client.Suggestion; 27 28 33 public class CategoryTableCellRenderer extends DefaultTableCellRenderer { 34 37 public CategoryTableCellRenderer() { 38 setIcon(new ImageIcon ()); 39 } 40 41 public Component getTableCellRendererComponent(JTable table, Object value, 42 boolean isSelected, boolean hasFocus, int row, int column) { 43 super.getTableCellRendererComponent(table, value, isSelected, 44 hasFocus, row, column); 45 46 Suggestion s = (Suggestion) value; 47 ((ImageIcon ) getIcon()).setImage(s.getIcon()); 48 setText(s.getType()); 49 50 return this; 51 } 52 } 53 | Popular Tags |