The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Interfaces



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Try a JScrollPane

Posted by Basti on December 27, 2001 at 10:18 AM

> I need to put a scrollbar in a JTextArea can someone help me, i have the scroll bar now i need to know how to make the JScrollBarHandler() to make the text in the JTextArea scroll.

> thanks in advanced

Why don't you put the JTextArea into a JScrollPane?
final JTextArea ta = new JTextArea(20,50);
final JScrollPane sp = new JScrollPane(ta);

This way the ScrollBars come up automatically if the text is bigger than the JTextArea.

I Hope this helps you!


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us