Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JEditorPane problem displaying non-English text in 1.4 (Linux)  RSS feed

 
MarutiG Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai
I am trying to display a non English text in JEdiorPane . This is working fine with 13 but not with 1.4. (In 1.4 the non-English text is being rendered in english font).
I am giving the HTML file and the java code that displays the html file below
somebody pl help

HTML file:
<HTML>
<HEAD>
<STYLE>
font.English0 {font-family:Courier,TimesNewRoman,helvetica,VERDANA,sansserif; font-style:normal;font-size:14pt;}
font.telugu1 { font-family: Tl_tthemalatha;font-style: normal;font-size: 12pt; }
font.English1 { font-family: Courier;font-style: normal;font-size: 22pt; }
</STYLE>

</HEAD>
<BODY>

<font class=telugu1> the non english text </font>
</BODY>
</HTML>
the java code is.............
class outpane extends JFrame
{
JEditorPane jep;
Syllable sl;
public static void main(String[] args)
{
new outpane(args[0]);
}
outpane(String str)
{

jep = new JEditorPane();
jep.setEditable(false);
jep.setContentType("text/html");
JScrollPane js = new JScrollPane(jep);
this.getContentPane().add(js);
setSize(400,500);
setVisible(true);
setText(str);

}
void setText(String str)
{

try{
BufferedReader br1;
FileInputStream fr1;

fr1=new FileInputStream(str);
br1=new BufferedReader(new InputStreamReader(fr1,"ISO8859-1"));
String s = new String();
String s1 = new String();
int j = 0;
while((s = br1.readLine()) != null)
{
s += "\n";
// Some mappings...
}
jep.setText(s1);
fr1.close();

}catch(Exception e){System.out.println("Exp");}
}
}

To menction again this works fine in 1.3. In 1.4 the font is not beibg recognised

THIS HAPPENS ONLY ON LINUX (RH8)
Thanks in Anticipation
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!