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

Bug regarding inserting images/links/anchors...

    XMLWordPrintable

    Details

      Description

      ==========================================================================
      carlos.lucasius@canada 1998-04-08:
      Bug from Corel (licensee) for JFC1.1 using JDK1.1.4 on WINNT4.0.
      Corel: "Very critical bug for our product - requires immediate attention."

      As it is, images/links/anchors are loaded from file and rendered okay
      (maybe some sort of icon for anchors...). It would be nice to have an
      API added to HTMLEditorKit (or some other class) to allow for the insertion
      of these elements at a given location. Right now, we can add them by
      adding/modifying the appropriate attributes in the document but this is
      a little clumsy since it's highly dependent on your specific implementation.

          This also is not always possible because there has to be a paragraph
      element already present to insert the text (as far as I know there's no
      easy way of inserting a paragraph element) For instance try the following:
          1. open an HTML file which contains 2 consecutive horizontal rules.
          2. place the cursor between the two. (it will be at start of the
      second rule)
          3. type a character.
          4. The following Exception is thrown

      Exception occurred during event dispatching:
      java.lang.NullPointerException:
              at
      com.sun.java.swing.text.DefaultStyledDocument.insertUpdate(DefaultStyledDocument.java:389)

              at
      com.sun.java.swing.text.AbstractDocument.insertString(AbstractDocument.java:412)

              at
      cccorp.cabot.htmledit.engine.CCCEditorPane.replaceSelection(CCCEditorPane.java:248)

              at
      com.sun.java.swing.text.DefaultEditorKit$DefaultKeyTypedAction.

      actionPerformed(DefaultEditorKit.java:650)
              at
      com.sun.java.swing.text.JTextComponent.processComponentKeyEvent(JTextComponent.java:1026)

              at
      com.sun.java.swing.JComponent.processKeyEvent(JComponent.java:1256)
              at java.awt.Component.processEvent(Component.java:2138)
              at java.awt.Container.processEvent(Container.java:890)
              at java.awt.Component.dispatchEventImpl(Component.java:1764)
              at java.awt.Container.dispatchEventImpl(Container.java:935)
              at java.awt.Component.dispatchEvent(Component.java:1704)
              at
      java.awt.LightweightDispatcher.processKeyEvent(Container.java:1407)
              at
      java.awt.LightweightDispatcher.dispatchEvent(Container.java:1393)
              at java.awt.Container.dispatchEventImpl(Container.java:922)
              at java.awt.Window.dispatchEventImpl(Window.java:443)
              at java.awt.Component.dispatchEvent(Component.java:1704)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              svioletsunw Scott Violet (Inactive)
              Reporter:
              clucasius Carlos Lucasius (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: