JDK-4308782 : JEditorPane must be fully compatible with HTML4.0
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0,1.3.0_01,1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,solaris_7
  • CPU: generic,sparc
  • Submitted: 2000-02-01
  • Updated: 2002-05-13
  • Resolved: 2002-05-13
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description

Name: tb88898			Date: 01/31/2000


The current implementation of JEditorPane only supports HTML
3.2 with a few additional features.   It would be desirable to
have full JTML 4.0 support.


======================================================================

Name: bsC130419			Date: 07/16/2001


java version "1.3.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)



Hi,
When using JEditorPane with an html document, the parser doesn't deal with
XHTML correctly. (XHTML being HTML that conforms to XML standards).

Parsing a line such as this:
<p/>
will leave one ">" viewable in the html view.
This is critical to work with xml tag libraries and other xml documents that
don't mess up xml parsers.
Thanks,
Laramie

=================== H.java ==============================
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
 import javax.swing.text.html.*;
 import javax.swing.border.*;
 import javax.swing.colorchooser.*;
 import javax.swing.filechooser.*;
 import javax.accessibility.*;

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

 public class H {
    public static void main(String[] args)
    {
        new H();
    }

     public H() {
       try {
            URL url = null;
            String path = null;
            path = "/index.html";
            url = getClass().getResource(path);
            JEditorPane html = new JEditorPane(url);
            html.setEditable(false);
            JScrollPane scroller = new JScrollPane();
            JViewport vp = scroller.getViewport();
            vp.add(html);

            JFrame f = new JFrame("test");
            f.setSize(300,350);
            f.getContentPane().add(scroller, BorderLayout.CENTER);
            f.setVisible(true);
         } catch (Exception e) {
             System.out.println("Exception: " + e);
         }
     }

 }
====================================================

========== index.html ==============================
<html>
<body>
<p>You should see extra > characters:</p>
<br/>
<p/>
</body>
</html>

=====================================================
(Review ID: 128207)
======================================================================

Comments
EVALUATION We do not plan to provide full HTML 4.0 support in Merlin. hans.muller@Eng 2000-03-06 Closing this bug seems incorrect unless you have no intention of providing HTML 4.0 support in a post Merlin relese. roger.brinkley@Eng 2001-04-03
06-03-2000