esuslogo
 [To advertise Java(tm) Events here, contact joris@esus.com!]
banner

Java™
by example!






New @ Esus.com


  gb  In-house search engine for better results!

  gb  Get updates with the esus.com
newsletter!









  Home 
 Browse Categories 
 Ask a Java Question 
 Help 
  For Java Tips & Tricks, subscribe to the esus.com newsletter!
Search Java Q&A, Links, API's:   adv 

How do I use a Japanese font in my Swing components?
To answer this question, I installed a japanese font to play around with (I am Belgian and don't know Japanese). It's called MS Mincho and you can download it here.
After installing it, we need to modify the JDK properties so that it recognizes this font. I assume here that you are using JDK1.2.2.
Go to c:\jdk1.2.2\jre\lib\ and copy font.properties.ja to font.properties (smart to make a backup of the original font.properties first). Then modify this file font.properties and change serif.plain.0 to MS Mincho,ANSI_CHARSET. Also add the entry filename.MS_Mincho=msmincho.ttf.

You can use this test program that allows you to display RTF text, using the RTFEditorKit. Point the URL in the application to http://www.esus.com/docs/Hello.rtf

This code sample is only viewable to esus.com members
Login or become a member!


Feel free to post any more sample code or detailed explanation on how to change the font.properties file to add MS Mincho properly.


Further Information
Author of answer: Joris Van den Bogaert

Comments
Comments to this answer are only viewable by members. Login or become a member!





Terms of Service | Privacy Policy | Contact

Copyright © 2000-2003 Esus.com - All Rights Reserved 
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. Esus.com is independent of Sun Microsystems, Inc. All other trademarks are the sole property of their respective owners.