Duplicate :
|
Name: yyT116575 Date: 09/18/2001 Java(TM) Plug-in:Version 1.4.0 Using JRE version 1.4.0-beta2 java HotSpot(TM) Client VM JEditorPane cannot render even the simplest HTML from a URL in the merlin-beta2. Put the class files, HTML loader & simple.htm on a web server & try under 1.3.X and the latest 1.4 beta2... Yields link text of simple.htm under 1.3.X and file not found under 1.4.0 Beta2 - b77... HTMLinJEP.java =========== import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.text.*; import java.net.*; public class HTMLinJEP extends JApplet { static URL sampleURL = null; static String startup = "View HTML"; public void init() { try { System.out.println("======== Applet Init =========="); sampleURL = new URL(getCodeBase()+"simple.htm"); } catch (Exception exc) { startup = "Error in init:"+exc; System.out.println(startup); } getContentPane().setLayout(new BorderLayout()); final JDesktopPane desktop = new JDesktopPane(); JInternalFrame makeFrame = new JInternalFrame("Frame Maker",true,false,true,true); JButton button = new JButton(startup); button.addActionListener(new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent event) { final JInternalFrame internal = new JInternalFrame("Frame",true,true,true,true); JEditorPane epOutput = null; try { epOutput = new JEditorPane(); epOutput.setPage(sampleURL); } catch (Throwable eee) { System.out.println("Unable to set editorpane to URL:"+eee); } internal.getContentPane().add(epOutput,BorderLayout.CENTER); internal.setBounds(25,25,250,200); internal.setVisible(true); desktop.add(internal); repaint(); } }); makeFrame.getContentPane().add(button,BorderLayout.CENTER); desktop.add(makeFrame); makeFrame.setVisible(true); getContentPane().add(desktop,BorderLayout.CENTER); makeFrame.setBounds(300,50,300,100); getContentPane().validate(); getContentPane().setVisible(true); } } HTMLinJEP.html ============= <html> <OBJECT id="JApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 100% HEIGHT = 100% codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"> <PARAM NAME = CODE VALUE = HTMLinJEP.class > <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> <COMMENT> <EMBED type="application/x-java-applet;version=1.3" java_CODE = HTMLinJEP.class WIDTH = 100% HEIGHT = 100% pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"> <NOEMBED> </COMMENT> alt="Your browser understands the tag but isn't running the applet, for some reason (Java Plug-In 1.3.0+ not available?)." Your browser is completely ignoring the applet tag! </NOEMBED> </EMBED> </OBJECT> </html> Simple.htm ================ <html> <head> <title>Web HTML Setup and Access </title> </head> <body> <BR> <a HREF="Splash.html">Press here to access</a><BR> <BR> </body> </html> (Review ID: 131946) ======================================================================