I\'m using JScrollPane to allow scrolling in a JFrame that has a text component that\'s serving as a text editor. What I want to do, after setting the text in this editor,
You can use the method setCaretPosition(0) just after setText(String t) of your text component.
setCaretPosition(0)
setText(String t)