This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes select a row inJTextArea using CaretPosition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "select a row inJTextArea using CaretPosition" Watch "select a row inJTextArea using CaretPosition" New topic
Author

select a row inJTextArea using CaretPosition

akila kann
Greenhorn

Joined: May 31, 2001
Posts: 2
How to select a entire row in JTextArea using the Caret Position?.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
If you are using JDK1.3 you can use the setSelectionStart(int) and setSelectionEnd(int) methods. Course you would need to know the Caret Positions that correspond to those.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: select a row inJTextArea using CaretPosition