Currency Symbol in JTable

R

RVince

The more I read the Java docs and google on this issue -- the more
confused
I am becoming. If I am setting a cell in a JTable to a certain
currency,
formatted to a particular Locale, it works out fine for me if My
Locale is
US say. Things print with the leading $ sign, etc.

however, when I change Locales, I am not getting the proper currency
symbol
printed (say, the Yen Symbol,. or the Euro Symbol) instead I am
getting
rather a grey box in lieu of the symbol.

I have tryed altering the font of the JTable to no avail. Clearly I
am
missing someting that is a particular quirk here. Does anyone have
experience with this issue and can anyone point me in the right
direction
here. Thanks.

DefaultTableModel dtm;
double fdollars;
Local locale = Locale.JAPAN.
.....
dtm.setValueAt(NumberFormat.getCurrencyInstance(locale).format(fdollars),
q,
2);
 
R

Roedy Green

I have tryed altering the font of the JTable to no avail. Clearly I
am
missing someting that is a particular quirk here. Does anyone have
experience with this issue and can anyone point me in the right
direction

use http://mindprod.com/applet/fontshower.html
to see if the currency symbol is supported by the font you are using.

Use charAt(0) to ensure the correct symbol is in your String.
 
R

RVince

usehttp://mindprod.com/applet/fontshower.html
to see if the currency symbol is supported by the font you are using.

Use charAt(0) to ensure the correct symbol is in your String.

Roedy,

Its printing char 164 which is character '¤' using DialogInput font
(which, on your sight, shows as having the Yen symbol). I'm missing
something.
 
D

Daniel Pitts

RVince said:
Roedy,

Its printing char 164 which is character '¤' using DialogInput font
(which, on your sight, shows as having the Yen symbol). I'm missing
something.
Just a note: The ¤ symbol is the generic symbol for currency.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top