Format number as currency in JTable?
2 answers
There are several ways to approach this. The easiest way is to just populate this column with a custom object that implements currency formatting in its method toString()
.
Another is to use a custom cell renderer. Here's a sample code to set it up. The advantage of this would be that it was "made directly onto the JTable after it was filled with data".
+2
a source to share