Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4134297

Can't use JTextPane in Netscape

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • x86, sparc
    • solaris_2.5.1, windows_95



      Name: rk38400 Date: 05/01/98


      I can display HTML in the AppletViewer but I get
      a security exception in Netscape. I have tried using
      the Capabilities API but that doesn't work either.

      import java.applet.*;
      import java.awt.*;
      import java.util.*;
      import java.net.*;
      import java.io.*;

      import com.sun.java.swing.*;
      import edu.iastate.academy.util.*;

      public class TestFrame extends JApplet {
          JTextPane pane;
          public void init() {
              pane = new JTextPane();
              getContentPane().add(pane);
          }

          public void start() {
              try {
                  pane.setPage(new URL(getDocumentBase(),"test.html"));
              }
              catch (MalformedURLException exc) {
              }
              catch (IOException exc) {
              }
          }
      }

      netscape.security.AppletSecurityException: security.checkResourceAccess
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(Compiled Code)
        at java.lang.SecurityException.<init>(Compiled Code)
        at netscape.security.AppletSecurityException.<init>(Compiled Code)
        at netscape.security.AppletSecurityException.<init>(Compiled Code)
        at netscape.security.AppletSecurity.checkResourceAccess(Compiled Code)
        at java.lang.SecurityManager.checkResourceAccess(Compiled Code)
        at java.lang.ClassLoader.getSystemResourceAsStream(Compiled Code)
        at java.lang.Class.getResourceAsStream(Compiled Code)
        at com.sun.java.swing.text.html.HTMLEditorKit.loadStyleSheet(Compiled Code)
      * at com.sun.java.swing.text.html.HTMLEditorKit.<init>(Compiled Code)
        at com.sun.java.swing.JEditorPane.createEditorKitForContentType(Compiled Code)
        at com.sun.java.swing.JEditorPane.getEditorKitForContentType(Compiled Code)
        at com.sun.java.swing.JEditorPane.setContentType(Compiled Code)
        at com.sun.java.swing.JEditorPane.setPage(Compiled Code)
        at TestFrame.start(Compiled Code)
        at netscape.applet.DerivedAppletFrame$StartAppletEvent.dispatch(Compiled Code)
        at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
        at java.awt.EventDispatchThread.run(Compiled Code)
        at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
      java.lang.IllegalArgumentException: Must be StyledEditorKit
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(Compiled Code)
        at java.lang.IllegalArgumentException.<init>(Compiled Code)
        at com.sun.java.swing.JTextPane.setEditorKit(Compiled Code)
        at com.sun.java.swing.JEditorPane.setContentType(Compiled Code)
        at com.sun.java.swing.JEditorPane.setPage(Compiled Code)
        at TestFrame.start(Compiled Code)
      * at netscape.applet.DerivedAppletFrame$StartAppletEvent.dispatch(Compiled Code)
        at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
        at java.awt.EventDispatchThread.run(Compiled Code)
        at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
      (Review ID: 29445)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: