public void setValue(Object value) {

        //
        // Return an empty string if the value is null
        //
        if (value == null) {
            setText(new String());
            return;
        }

        //
        // We must have a Number
        //
        if (!(value instanceof Number))
            throw new IllegalArgumentException("Value is not a Number");

        //
        // Format the number as a double value
        //
        String text = formatter.format(((Number)value).doubleValue());

        //
        // Remove a leading minus sign if the value is zero
        //
        if (text.charAt(0) == '-') {
            int index;
            int length = text.length();
            for (index=1; index<length; index++) {
                char c = text.charAt(index);
                if (c != '0' && c != '.')
                    break;
            }

            if (index == length)
                text = text.substring(1);
        }

        //
        // Set the foreground color to red if the value is negative
        //
        if (text.charAt(0) == '-')
            setForeground(Color.RED);
        
        //
        // Set the text value for the number
        //
        setText(text);
    }