title: Dynamically resize textarea to fit content
body: <p>Here is a textarea I have put in my program using netbeans. The first image shows what the textarea looks like when I run the program. The second image is show the textarea after I press a button that adds about 50 "Hello world" strings to the text area - only the first 6 get shown. I need the textarea's height to dynamically increase to fit all these strings. Anyone know how to do it?</p>
  
  <p>Edit: I dont want scrollbars so using a JScrollPane is not an option.</p>
  
  <p><img src="https://i.stack.imgur.com/bga2e.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/rEHJf.png" alt="enter image description here"></p>