Name: dbT83986 Date: 01/11/99
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>
(Review ID: 52362)
======================================================================