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

HTMLEditorKit.write(...) does not work.

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      swing1.1
    • CPU:
      sparc
    • OS:
      solaris_2.5.1
    • Verification:
      Verified

      Description



      Name: aaC67449 Date: 05/18/98


        HTMLEditorKit.write(...) does not work.
        It throws IOException for any instance of StyledDocument, but there is no default document class that does not implement this interface.

           
      ------------------Example-----------------------------------
      import java.awt.swing.text.html.*;
      import java.awt.swing.text.html.*;
      import java.awt.swing.text.*;
      public class Test {

         public static void main(String argv[]) {
              String test="<html> <head><title>Swing tests</title></head><body><OL type=I><LI><P>Test 1</P></ol></body></html>";
              HTMLEditorKit c= new HTMLEditorKit();
              
              
              try {
                 HTMLDocument hdoc=new HTMLDocument();
                 c.write(System.out,hdoc,0,6);
              } catch(Exception e) {
                  e.printStackTrace();
              }
              
              try {
                 Document doc = c.createDefaultDocument();
                 c.write(System.out,doc,0,6);
              } catch(Exception e) {
                  e.printStackTrace();
              }
        
         }

      }
      -------------------Output------------------------------------
      java.io.IOException: TBD
              at java.awt.swing.text.html.HTMLEditorKit.write(HTMLEditorKit.java:147)
              at java.awt.swing.text.DefaultEditorKit.write(DefaultEditorKit.java:135)
              at Test.main(Test.java:12)
      JAVA2D_USEPLATFORMFONT not set
      Disabling platform fonts
      java.io.IOException: TBD
              at java.awt.swing.text.html.HTMLEditorKit.write(HTMLEditorKit.java:147)
              at java.awt.swing.text.DefaultEditorKit.write(DefaultEditorKit.java:135)
              at Test.main(Test.java:18)


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

        Attachments

          Activity

            People

            Assignee:
            smanisunw Sunita Mani (Inactive)
            Reporter:
            aalievsunw Artem Aliev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: