Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Displaing UTF-8 format text in swing components

 
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());
 
Author
Posts: 974
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.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!