Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Japanse font (Urgent! Please help)

 
S Dan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to set text to a JLabel. Suppose I have a string variable called
"description". "description" contains japanese characters.
when I use jLabel.setText(description), it works fine and shows the japanese
fonts properly. Now if I try to wrap the description with html tags..e.g

jLabel.setText("<html><body><font FACE=\"sans-serif, Arial, Helvetica, Geneva\">"+description+"</font></body></html>");

then it just messes the japanse fonts. Why is that so? How can I wrap that in html?
Thanks in advance.
-Dan
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi S Dan

I am not sure whether this would help you, but u could try it.

(If u are using WindowsOS) Go to Control Panel => Date, Time, Language, and Regional Options => Regional and Language Options, then choose Japanese as Standards and formats Setting. Hope it works for u.
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would find out what font your JLabel uses to do it's display with. You are explicitly giving the HTML a list of fonts to choose from, but perhaps those fonts don't support Japanese characters.

I know that I have to use a special font in order to make chinese characters appear properly in my swing app, otherwise I get boxes where the characters should be.

Cheers, Jared.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic