如题:
用word新建一个空文档,输入一排英中文混排的文字,另存为rtf文件:c:\test.rtf。
JEditorPane jEditorPane1 = new JEditorPane(); 
jEditorPane1.setContentType("text/rtf"); 
File file = new File ("c:/test.rtf");
String str = file.getAbsolutePath();
str = "file:"+str;
jEditorPane1.setPage(str);
jEditorPane1.setEditable(false);
JFrame jframe = new JFrame("test");
jframe.setContentPane(jEditorPane1);
jframe.setBounds(0,0,100,100);
jframe.setVisible(true);显示出来的英文字符正确,中文乱码。