🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9440

JEdtorPane & RTF files

#9440
From: George McLaughlin
Date: Sun, 19 Mar 2000 00:00
35 lines
1525 bytes
Hi, I'm trying to display RTF Files(Japanese) with no luck. Files
written in English display
w/out problems. Does any one know the proper setting for the content
type for this?
My code snipped attached. Any help greatly appreciated.

.....
class DocPane extends JScrollPane {
    JEditorPane rtf = null;
    String urlString = null;
     public DocPane() {
        rtf = new JEditorPane();
       try {
         File f = new File ("C:/rtf/myhelpfile.rtf");
          s = "file:"+f.toString();
      try{
          URL url = new URL(s);
          rtf = new JEditorPane();
          rtf.setContentType("text/rtf; charset=Shift-jis");
          rtf.setEditable(false);
          JViewport vp = getViewport();
          vp.add(rtf);
          rtf.setPage(url);
       } catch (MalformedURLException e) {
         System.out.println("Malformed URL: " + e);
       } catch (IOException e) {
         System.out.println("IOException: " + e);
       }
    }
}


Thanks,

george
Technical Details
Message-ID: <38D4AD55.C50634CA@nrm.root.or.jp>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,ce4ca1446e775e20,start
X-Google-Attributes: gid111d45,public
From: George McLaughlin <gmac@nrm.root.or.jp>
Subject: JEdtorPane & RTF files
Date: 2000/03/19
Message-ID: <38D4AD55.C50634CA@nrm.root.or.jp>
X-Deja-AN: 599476471
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Accept-Language: ja
Content-Type: text/plain; charset=iso-2022-jp
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing