The most interesting part of your answer was: " $ java -jar dist / test6.jar "! Does this really show the real characters (just like the name of the frame) ?! not boxes or trash? I'm sorry if I find this difficult because the only problem in my evolving work with Java takes so long without any answer, no search, no forum requests!
So what can I do? which font should i use? Unfortunately, I'm not so familiar with fonts, so far I just used global fonts in Java (Serif, SansSerif, etc.) and only changed their size or style, but after you suggested that I study a few Persian ttf fonts through these codes
File fontFile = new File("F_JADID.TTF"); Font font = Font.createFont(Font.TRUETYPE_FONT, fontFile); show.setFont(font.deriveFont(15f));
but only the boxes were the result! (just using HardCoding) I think I should mention that my environment is xp victory, and I have this problem not only on my machine, but also on another xp os launch. And I am using jdk6u17.
I can agree with you, suspecting fonts, because the encoding problem (in my experience) appears with a question mark, but garbage or empty fields related to character rendering. But still, I have a problem, like on the first day :( Which font are you using, and another question that I have encountered: Why the swing does not have problems without specifying the font, but AWT.
Addendum : Oscar Reyes in this page for providing this link and thanks to StackOverflow :) They saved me! from in this section I must indicate:
An application that uses peer-to-peer AWT components can only use logical font names.
and in this section you should indicate:
For applications that use the highly reliable AWT components, Sun JRE selects fonts for Chinese, Japanese, or Korean only when running on host operating systems localized for those specific languages.
Yes, you guess, right! setting the OS locale to Farsi, I got the correct result.
but I still have to research and see how you can get the right result without setting the correct locale from this article.
I will explain how when I get the result, but I will still listen here. I wish you good luck.