• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTextArea and scrolling

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have the following code to make my JTextArea scroll, but it isn't. It is connected to a JScrollPane, but it isn't scrolling. I can see the scroll bar to the right of the text area, but the scroll bar is empty, it just has the two arrows at the top and bottom, but no scroller thing. The Text area and scroll bar seem to be not associated in any way. Here is my code:

What's the problem?
Any help is greatly appreciated.
Vinu
[ February 09, 2002: Message edited by: Vinu Murugesan ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing wrong with your code is that you are adding both the text area and the ScrollPane. You only need to add the scroll pane. It contains your text area.
If there is no text in a text area, then there is nothing to scroll. Try filling the textArea with text that goes beyond the boundries and I bet your scrolling bar will show up. If you reply to this post again, notice the scroll bar to the right of what you typing right now. It is set up the same way.
[ February 09, 2002: Message edited by: Gregg Bolinger ]
 
Vinod Kumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much!
After I removed the JTextArea from the panel it worked. Now I know that you should add only the JScrollPane.
Thanks again,
Vinu.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic