FileDocCategorySizeDatePackage
BigRenderer.javaAPI DocExample987Thu Oct 24 20:14:24 BST 2002None

BigRenderer

public class BigRenderer extends DefaultTableCellRenderer

Fields Summary
double
threshold
Icon
bang
Constructors Summary
public BigRenderer(double t)


     
    threshold = t;
    setHorizontalAlignment(JLabel.RIGHT);
    setHorizontalTextPosition(SwingConstants.RIGHT);
  
Methods Summary
public java.awt.ComponentgetTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int col)

    // be a little paranoid about where the user tries to use this renderer
    if (value instanceof Number) {  
      if (((Number)value).doubleValue() > threshold) {
        setIcon(bang);
      }
      else {
        setIcon(null);
      }
    }
    else {
      setIcon(null);
    }
    return super.getTableCellRendererComponent(table, value, isSelected,
                     hasFocus, row, col);