1 22 23 package org.enhydra.kelp.common.swing; 24 25 import java.awt.Component ; 26 import javax.swing.*; 27 import javax.swing.table.*; 28 29 33 public class CellRendererWithToolTip extends DefaultTableCellRenderer { 34 35 38 public CellRendererWithToolTip() {} 39 40 61 public Component getTableCellRendererComponent(JTable table, 62 Object value, boolean isSelected, boolean hasFocus, int row, 63 int column) { 64 Component c = super.getTableCellRendererComponent(table, value, 65 isSelected, hasFocus, row, column); 66 67 if (c instanceof JLabel) { JLabel l = (JLabel) c; 69 70 l.setToolTipText(l.getText()); 71 } 72 73 return c; 74 } 75 76 } 77 | Popular Tags |