aspose file tools*
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to scroll in a JEditorPane