This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread 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
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: select a row inJTextArea using CaretPosition
 
Similar Threads
JTable auto select row
In JIDE- Jtable - how to get the actual row index (if the table is sorted row id is changing)
Datatable with only one select all checkbox in the first row
Selected row highlighted only for split second
How can i explicitly lock a row of a Table