Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaing UTF-8 format text in swing components

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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());
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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