Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Swing / AWT / SWT
search abilities in JText?
Dean Watson
Greenhorn
Posts: 6
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm fairly new to Swing so sorry if this is too simple. I there build in ability to find text inside a JTEXT area? I know I can do a getText() and search for a
string
but this seem cludgy. can anyone share a better solution?
Thanks,
Dean
Robert , doodle
Greenhorn
Posts: 8
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
something like..
<pre>
int index=textArea.getText().indexOf(searchString);
textArea.setSelectionStart(index);
textArea.setSelectionEnd(searchString.length());
textArea.select(index,textArea.getSelectionEnd());
</pre>
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
sinc scrollbars
swing
How to get these two classes to interact?
Undo and Redo in JText viewer?
Please Help me Program on Speech Recognizer Program Urgent!!!
More...