wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Showing Beginning of Text in JTextField by Default Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Showing Beginning of Text in JTextField by Default" Watch "Showing Beginning of Text in JTextField by Default" New topic
Author

Showing Beginning of Text in JTextField by Default

Scott Florez
Ranch Hand

Joined: Dec 05, 2006
Posts: 58
I have several JTextFields of a set size that I fill with text read from a database. Some of that data is larger than the JTextFields and thus requires the user to "scroll" sideways to view all of the data. However, when data is read this way, the default view shows the last part of the text instead of the first part. How do I set the JTextFields' default view to show the beginning of the text? Thanks!
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
Have you tried setCaretPosition( 0 );


SCJP1.4
Scott Florez
Ranch Hand

Joined: Dec 05, 2006
Posts: 58
Originally posted by Mathias Nilsson:
Have you tried setCaretPosition( 0 );


That's what I needed. Thanks a lot!
 
wood burning stoves
 
subject: Showing Beginning of Text in JTextField by Default