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

Copy from an HTML JEditorPane puts extra C/R on clipboard

XMLWordPrintable

      FULL PRODUCT VERSION :
      1.4.2-b28

      ADDITIONAL OS VERSION INFORMATION :
      linux 2.4.21-99

      A DESCRIPTION OF THE PROBLEM :
      Anything copied from an HTML JEditorPane puts extra C/R on clipboard at the beginning and the end of the text copied.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the test case. With the plain text version copy and paste work correctly, With the html version the copy puts extra C/R

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the HTML version to work like the plain text version
      ACTUAL -
      The HTML version is broken

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JEditorPane;
      import javax.swing.JFrame;

      public class htmlcopytest
      {
          public static void main(String[] args)
      {
      JEditorPane editorPane = new JEditorPane("text/plain", "Now is the time for all good men to come to the aid of their party");
      // JEditorPane editorPane = new JEditorPane("text/html", "<html><body>Now is the time for all good men to come to the aid of their party</body></html>");
      JFrame frame = new JFrame();
      frame.getContentPane().add(editorPane);
      frame.setSize(300, 300);
      frame.setVisible(true);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Create your on TransferHandler
      ###@###.### 2005-1-13 02:47:38 GMT

            shickeysunw Shannon Hickey (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: