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

Copy & Paste with formated text add additional newlines

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6u2
    • Fix Version/s: 6
    • Component/s: client-libs
    • Labels:

      Description

      If I paste a formated text in an editable JTextPane or JEditorPane then it will insert an additional paragraph before and after the inserted line.

      To reproduce:
      - copy some of the text in TextPane (Ctrl-C).
      - paste the text (Ctrl-V).
      - observer 2 additional paragraphs above the pasted text.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class TestCopyAndPaste {
          
          public static void main( String[] args ) {
              
              JFrame frame = new JFrame();
              
              JTextPane text = new JTextPane();
              
              text.setContentType( "text/html" );
              
              text.setText( "<p> normal Text <font color='red'>red Text</font> <b>bold text</b>" );
              
              frame.add( text );
              
              frame.pack();
              
              frame.show();
              
          }
          
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                peterz Peter Zhelezniakov (Inactive)
                Reporter:
                ryeung Roger Yeung (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: