dcsimg
JText Area ,JScrollPane
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chetan_Arora
Posted On:   Monday, January 21, 2002 01:31 PM

hi
I am opening a text file in the text area embedded in a scrollpane.
Whenever I open the file the focus goes to the end of file ,if size is greater than that of jtext Area ..
How can I shift the focus to the top of the document if I am opning the file from a JFileChooser??

Re: JText Area ,JScrollPane

Posted By:   Anonymous  
Posted On:   Monday, January 21, 2002 01:44 PM

After loadind the file into the JTextArea, call the textAre.setCaret(0) and the JscrollPane will scroll back to the top
About | Sitemap | Contact