Hi Audrius,

Am Donnerstag, den 03.11.2005, 15:50 +0100 schrieb Meskauskas Audrius:
> Our JTextField contains an "imaginary" end of line character (0xA), but 
> the new text must be always inserted before it, not after. When clicking 
> right from the last character in the field, the 
> PlainTextView.viewToModel should return the position before the end of 
> line character and not after the end of line character. Otherwise the 
> inputs blocks. If the empty field receives focus by the mouse click, the 
> caret position is always set after the 0xA and, a result, it is never 
> possible to enter any text in the field.

Wow, good observations and bug finding. You are right, the Content model
of the PlainDocument contains an imaginary 0xA character at the end.
This should not be exposed via the Document accessor methods, also not
by the viewToModel or getText. Your patch fixes you problem, but at best
hides the real problem, beeing that this newline character is somehow
counted in in getText.

I can fix this tomorrow. Thanks for this good observations.

/Roman

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to