How to make different fonts appear in JTextField. Say a Hindi font or chinese font
In the java code you must put only the following line
JTextFiledName.setFont(new Font("Shusha", Font.PLAIN, 16));
Make sure you have the following setup done.
Add the line below.
Note if you are adding another font make sure it becomes
Then repeat for bold, italics etc
... dialog.bold.3=Shusha,SYMBOL_CHARSET,NEED_CONVERTED ..... dialog.italic.3=Shusha,SYMBOL_CHARSET,NEED_CONVERTED .... dialog.bolditalic.3=Shusha,SYMBOL_CHARSET,NEED_CONVERTED
After that add the following line under where its written
# font filenames for reduced initialization time # filename.Shusha=SHUSHA.TTF
Here SHUSHA is the font name. It can be thoolica.ttf. I think its better to follow the same case of the one shown under the windows/font directory. Like SHUSHA is in all caps
Then add to the line below
# Static FontCharset info. # fontcharset.dialog.3=sun.awt.CharToByteSymbol
Now try running the application and enter a text in the text field and voila you get it in the language you want it.
And dont forget to have the font installed in your windows/font directory. If still not working make a copy in the fonts directory under the jvm/fonts directory