This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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.
Have you checked out Aspose?
subject: format double precision in Jtable
It's not a secret anymore!