Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> I am new to java...& i have this project coming up..I'm been tring to do a search for a string feature in the project..The text i want to search is inputted through the JOptionPane & the area to be searched is JTextArea...After i find the string how can i get it selected in the JTextArea.. I haven't bothered to look up the exact methods (but then neither have you!). Try something like this: search for the substring using the indexOf method of the String Class - this returns the starting point of your target string. Then use the setSelectionStart and setSelectionEnd methods of the JTextArea. hope this helps richard Replies: |
Sponsored Links
|