This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to scroll in a JEditorPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to scroll in a JEditorPane" Watch "How to scroll in a JEditorPane" New topic
Author

How to scroll in a JEditorPane

Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 319
I am displaying an HTML document in a JEditorpane and I want to scroll to a specific word in the document. How do I do it?


Your help will be greatly appreciated,
Alejandro Barrero
Alejandro Barrero
Ranch Hand

Joined: Aug 01, 2005
Posts: 319
Found it. JtextComponent.select(int start, int end) does the trick.
 
GeeCON Prague 2014
 
subject: How to scroll in a JEditorPane