Display foreign language in JeditorPane

  • Follow


I wanna to display the other language like big5 in the JeditorPane, I
tried to do this:

import javax.swing.text.*;
import javax.swing.*;
import java.io.*;
import java.awt.*;

public class temp {

  public static void main(String[] args) {
      
     JEditorPane jep = new JEditorPane();

     jep.setEditable(false);   
     jep.setContentType("text/html; charset=big5");

     try {
       
	 jep.setPage("http://hk.yahoo.com");

     }
     catch (IOException e) {
       jep.setContentType("text/html");
       jep.setText("<html>Could not load http://www.oreilly.com
</html>");
     } 
      
     JScrollPane scrollPane = new JScrollPane(jep);     
     JFrame f = new JFrame("O'Reilly & Associates");
     // Next line requires Java 1.3
     f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     f.getContentPane().add(scrollPane);
     f.setSize(512, 342);
     f.show();
    
  }

}


It's not working... what's the problem? how can I solve it? any
detailed example
??


Cheers
Stephen
0
Reply wksh834 (1) 9/29/2003 4:57:52 AM


0 Replies
116 Views

(page loaded in 0.032 seconds)

Similiar Articles:













7/22/2012 2:45:53 PM


Reply: