One simple way, if all you want to do is fix the way it looks, is to set a
renderer for that column that will convert the Number to the appropriate
String representation.

@see Table.setDefaultRenderer
@see TableColumn.setCellRenderer

Regards
Sachin

----- Original Message -----
From: "Shomal Bafna" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, December 04, 2002 11:23 AM
Subject: JTable as a data entry screen


> I am trying to use JTable for data entry. I assign few columns to contain
> Integer class type and others with Float.  Now, the problem that arise is
> that Objects of Integer and Float are sub-classes  class Number and JTable
> has by default a Cell Editor defined to handle this Class type. The
problem
> arises only when a float type is handled. Floats which i use carry either
a 3
> decimals or 2 (basically quantity is represented in 3 decimals and amounts
in
> 2 decimals). But for eg if i have a float 3456.78 i want that to displayed
as
> 3456.780 and if 987.6 then 987.60. I can manipulate them in the required
form
> as a String but not as Number. Is there a way this can be done.
>
> Please pour you help.
>
> Thanks in advance
> Shomal
>
> _______________________________________________
> Advanced-swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/advanced-swing


_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to