1 package zirc.gui.smiliesWindow ; 2 3 import java.awt.* ; 4 import javax.swing.* ; 5 import javax.swing.table.* ; 6 7 20 27 28 public class CustomCellRenderer extends JLabel implements TableCellRenderer 29 { 30 31 private SmiliesCollection smiliesCollection ; 32 33 public CustomCellRenderer(SmiliesCollection smiliesCollection) 34 { 35 this.smiliesCollection = smiliesCollection ; 36 } 37 38 public Component getTableCellRendererComponent(JTable table, 39 Object value, 40 boolean isSelected, 41 boolean hasFocus, 42 int row, int column) 43 { 44 setText(smiliesCollection.getValueAt(row, column, 1).toString()) ; 45 setIcon((ImageIcon)smiliesCollection.getValueAt(row, column, 0)) ; 46 47 return this ; 48 } 49 } 50 | Popular Tags |