JDK-4202117 : JEditorPane does not properly display HTML content in an applet
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1999-01-11
  • Updated: 1999-02-09
  • Resolved: 1999-02-09
Related Reports
Duplicate :  
Description
 
In JDK1.2FCS, JEditorPane does not properly display HTML content
in applet (but does so in an application).  Even this simple
HTML is not displayed correctly.

<html>
<body>
<h1>test</h1>
</body>
</html>

Display of the above HTML in JEditorPane incorrectly displays
"test" without showing as a heading.   This works correctly
in SWING 1.0.3 in JEditorPane/Application as well as in JDK1.2FCS
in a Java application (as opposed to the applet).

Below is another example of garbled HTML:

>1. Compile the applet source shown below:
>
> import javax.swing.*;
>
> public class TestHtml extends JApplet
> {
>
>     public void init()
>     {
>  try {
>      JEditorPane e = new JEditorPane(getParameter("url"));
>      e.setEditable(false);
>
>      getContentPane().add(e);
>  } catch(java.io.IOException e) {
>      e.printStackTrace();
>  }
> }
>
> 2. Set the url parameter below to any http URL:
> <html>
> <head>
>     <title>HTML bug</title>
> </head>
> <body>
> <center>
> <APPLET  NAME="TestHtml" CODE = "TestHtml"
> WIDTH = 500 HEIGHT = 500 >
> <PARAM name="url" value="Any http URL here">
> </APPLET>
> </center>
> </body>
> </html>
>
> 3. Run the above applet.
>
> 4. The HTML is not displayed correctly. It is totally
>    garbled.
>
> Example HTML file tha tis garbled:
>
> <html>
> <head>
>     <title>Test</title>
> </head>
> <body>
> <h1>test</h1>
> <ul>
>         <li> one </li>
>         <li> two </li>
> </ul>
> </body>
> </html>
 
 

Comments
EVALUATION This is a duplicate of 4181905 and another bug based upon running under jdk1.1. The rewritten EditorKit is now extensible and uses two configuration files. Access to these configuration files is via getResourceAsStream, which should work fine under 1.1 (and does with IE but not Netscape). Under 1.2 the new security manager features need to be used because applet code is in the stack when these resources are loaded. Since this report seems more targeted toward 1.2 I'm marking it as a dup of 4181905. timothy.prinzing@eng 1999-02-09
09-02-1999