Hi, Shomai,

If I understand your problem correctly, you are trying to display
Float with fixed number of digits after the decimal point.

Well, did you try using DecimalFormat in your TableCellRenderer? A 
decimal format with pattern "##0.000" may help.

http://java.sun.com/j2se/1.4/docs/api/java/text/DecimalFormat.html


Mingjian 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf 
> Of Shomal
> Bafna
> Sent: Wednesday, December 04, 2002 12:53 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> 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
> 
> _______________________________________________
> Swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/swing
> 
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to