-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
6u10
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
JTextPane is basically the same as JTextArea except that you can selectively style certain sections of the text.
JTextArea has these convenience methods:
getLineCount()
getLineEndOffset(int line)
getLineOfOffset(int offset)
getLineStartOffset(int line)
Why are the same methods not present in JTextPane? After all, it is basically the same class as JTextArea apart from styling, hence, you still have the same need for methods like the above.
JUSTIFICATION :
I work a l lot with lines in JTextPanes and am tired of having to write my own code to do those calculations.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Those methods to be present in JTextPane.
ACTUAL -
Methods absent.
CUSTOMER SUBMITTED WORKAROUND :
None, other than hand writing your own code, which you should not have to.
JTextPane is basically the same as JTextArea except that you can selectively style certain sections of the text.
JTextArea has these convenience methods:
getLineCount()
getLineEndOffset(int line)
getLineOfOffset(int offset)
getLineStartOffset(int line)
Why are the same methods not present in JTextPane? After all, it is basically the same class as JTextArea apart from styling, hence, you still have the same need for methods like the above.
JUSTIFICATION :
I work a l lot with lines in JTextPanes and am tired of having to write my own code to do those calculations.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Those methods to be present in JTextPane.
ACTUAL -
Methods absent.
CUSTOMER SUBMITTED WORKAROUND :
None, other than hand writing your own code, which you should not have to.