Using the select() method is just the same as if the user selected 
text with the mouse.  In that case hitting Enter should replace the 
selected text with a carriage return.  If you are using select() to 
highlight an area of text and don't want the text affected by editing 
commands, consider using a highlighter.  It has been a while since I 
used Highlighter, but it worked very well for just this purpose.

At 6:47 PM +0530 7/16/01, Pradeep, Chinnaswamiah wrote:
>Hi ,
>
>     I came across a strange problem in JTextArea.Select a portion of text in a
>JTextArea and press the 'ENTER' (RETURN) key. The selected portion of the text
>disappears. Is this a feature of  JTextArea or a bug. How do you ignore this
>feature?
>Adding a keyListener or adding the ENTER key in the actionMap might prove
>costly.
>
>Thanks
>Pradeep
>_______________________________________________
>Advanced-swing mailing list
>[EMAIL PROTECTED]
>http://eos.dk/mailman/listinfo/advanced-swing

-- 
Bill Tschumy
Otherwise -- Austin, TX
[EMAIL PROTECTED]
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to