jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes format double precision in Jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "format double precision in Jtable" Watch "format double precision in Jtable" New topic

format double precision in Jtable

orey sattiga

Joined: Aug 27, 2002
Posts: 9
Hi ,
I need to format a column in a Jtable based on the some conditions. The column currently displays
double values without precision.
1) i need to display the double value only upto two decimal places.
2) I need to change the color of the text based one a condition.
My question is can i do both in the same cell renderer.. if so how??
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
I have some experience with JTable before, I think you may have to change number to string first to do this.
I agree. Here's the link: http://aspose.com/file-tools
subject: format double precision in Jtable
It's not a secret anymore!