Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Conrad McLaughlin
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic