-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
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.
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.
- relates to
-
JDK-4128492 JTextArea.getLineCount() of empty JTextArea returns 1
-
- Resolved
-