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

JTextArea.getLineCount() behaviour should be modified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: