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

JTextPane using WrappedPlainView does not wrap the last line of a multiline text

    XMLWordPrintable

Details

    Description

      JTextPane using WrappedPlainView does not wrap the last line of a multiline
      text under a certain condition.

      [Reproducer]
        MyTextPane.java
        sample.txt

      [Reproduction procedure]
      (1) Start MyTextPane.
        $ java MyTextPane
      (2) Enter Return key to input a new-line code in the JTextPane component.
      (3) Open sample.txt and copy all the text in sample.txt to clipboard.
      sample.txt contains 3 lines and only the last line does not end with a
      new-line code like the following:
        --- sample.txt ---
        aaa...aaa<NL>
        bbb...bbb<NL>
        ccc...<EOF>
        ---
      (4) Paste the clipboard-copy in the JTextPane. Only the last line ¿ccc...¿ is
      not wrapped.

      The last line ¿ccc...¿ should be wrapped as well as the other long lines
      (¿aaa...¿ and ¿bbb...¿ line) in the pasted text.


      Attachments

        Activity

          People

            aivanov Alexey Ivanov
            asaha Abhijit Saha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: