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

REGRESSION: In SDK1.4.1, pasting into JEditorPane creates a new paragraph

    XMLWordPrintable

Details

    • x86
    • linux, windows_98

    Description

      Name: rmT116609 Date: 09/12/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
      Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)


      FULL OPERATING SYSTEM VERSION : Windows 98 [Version 4.10.2222], Windows 2000

      DESCRIPTION OF THE PROBLEM :
      Pasting into JEditorPane creates an paragraph break each side of the pasted text. Pasting works OK in JDK1.3.1

      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Run the supplied program.
      2.Copy and paste some text.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expect the pasted text not to create paragraph breaks.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      import javax.swing.text.*;

      public class EditorPanePasteTest extends JFrame
      {
        JEditorPane ep = new JEditorPane();

        public EditorPanePasteTest()
          {
          setTitle("EditorPanePasteTest");
          setSize(500, 400);

          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

          Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
          setLocation((d.width - getWidth()) / 2, (d.height - getHeight()) / 2);

          ep.setContentType("text/html");
          try
            {
            String s = "Try to copy THIS and paste HERE. " +
                       "SDK1.4.1 creates a new paragraph";
            ep.getDocument().insertString(0, s, null);
            } catch (BadLocationException ble)
                {
                }

          getContentPane().add(new JScrollPane(ep), BorderLayout.CENTER);
          }

        public static void main(String[] args)
          {
          SwingUtilities.invokeLater(new Runnable()
            {
            public void run()
              {
              EditorPanePasteTest test = new EditorPanePasteTest();
              test.setVisible(true);
              }
            });
          }

      }

      ---------- END SOURCE ----------

      Release Regression From : 1.3.1_04
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 164411)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: