File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How Do I add a vertical scroll bar to a JTextArea? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How Do I add a vertical scroll bar to a JTextArea?" Watch "How Do I add a vertical scroll bar to a JTextArea?" New topic
Author

How Do I add a vertical scroll bar to a JTextArea?

Conrad McLaughlin
Greenhorn

Joined: Jan 31, 2006
Posts: 27
How Do I add a vertical scroll bar to a JTextArea?

At the moment text is appended to the text area and when there is too much text the text area increases for some reason.
Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
Can you send me the code snippet, as to where are you adding the TextArea? In what layout etc.
I may be able to help


-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
The tutorial recommends setting the number of rows and columns to control the size of the JTextArea. You can add the JTextArea to a JScrollPane easily:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Do I add a vertical scroll bar to a JTextArea?