@@ -0,0 +1,1130 @@
+//%0A// $Id: IntegerTableCellRenderer.java,v 1.1 2004/05/13 21:58:07 ray Exp $%0A%0Apackage com.samskivert.swing;%0A%0Aimport java.text.NumberFormat;%0A%0Aimport javax.swing.JTable;%0Aimport javax.swing.table.DefaultTableCellRenderer;%0A%0A/**%0A * A table cell renderer that that formats integers according to the%0A * locale's desires.%0A */%0Apublic class IntegerTableCellRenderer extends DefaultTableCellRenderer%0A%7B%0A    public IntegerTableCellRenderer ()%0A    %7B%0A        setHorizontalAlignment(RIGHT);%0A    %7D%0A%0A    // documentation inherited%0A    protected void setValue (Object value)%0A    %7B%0A        if (value instanceof Integer) %7B%0A            value = _nfi.format(((Integer) value).intValue());%0A        %7D else if (value instanceof Long) %7B%0A            value = _nfi.format(((Long) value).longValue());%0A        %7D%0A        super.setValue(value);%0A    %7D%0A%0A    // our number formatter%0A    protected NumberFormat _nfi = NumberFormat.getIntegerInstance();%0A%0A    /**%0A     * A convenience method for installing this renderer.%0A     */%0A    public static void install (JTable table)%0A    %7B%0A        table.setDefaultRenderer(Number.class, new IntegerTableCellRenderer());%0A    %7D%0A%7D%0A

A table cell renderer that formats integers.