JTextArea.getLineCount() behaviour should be modified

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.4.0
    • Affects Version/s: 1.4.0
    • Component/s: client-libs
    • None
    • beta
    • x86
    • windows_nt

      JTextArea.getLineCount() was changed to fix bug 4128492. Unfortunately, the new behaviour is less desirable as it was actually correct before. JTextArea.getLineCount() should be modified to return the following results for the following content:

      empty or "" -> 1 line
      "abc" -> 1 line
      "abc\n" -> 2 lines
      "abc\n\n" -> 3 lines
      etc...

      In order to justify this behaviour, think of it as returning the number of possible lines that the cursor can be moved to. Even with an empty JTextArea, there is still one line where the cursor sits and where content can be inserted.

            Assignee:
            Shannon Hickey (Inactive)
            Reporter:
            Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: