Bookmark Topic Watch Topic
  • New Topic

Displaing UTF-8 format text in swing components  RSS feed

 
Phani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have several text douments(UTF-8 format) of different languages.i'm
getting a problem while trying to load that text into
jTextArea(javax.swing package) . i want to know whether the swings
components support multi language font, if please tell me how to solve

while im trying to display the langauge Tamil , java.awt.TextArea is able to show that font
where as javax.swing.JTextArea is not supporting,showing in some unreadable format
I just want to use javax.swing.JTextArea , can i use that in such conditions

code :
FileInputStream fis = new FileInputStream(f);
BufferedReader br = new BufferedReader(new
InputStreamReader(fis , "UTF-8"));
while( (s = br.readLine()) != null)
{
sb = sb.append(s + " ");
}
String[] st = sb.toString().split("\\s");
for(int i = 0 ; i < st.length ; i++)
{
sb2 = sb2.append(st[i] + " ");
}

sb2 is the final string that will be used as jTextArea1.setText(sb2.toSTring());
 
Brian Cole
Author
Ranch Hand
Posts: 949
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
You have posted a duplicate question.

Please don't do that. It's not in your best interests. It tends to make people not want to help you.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!