aspose file tools*
The moose likes Beginning Java and the fly likes The scrollbar is unable for uneditable JTextArea? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The scrollbar is unable for uneditable JTextArea?" Watch "The scrollbar is unable for uneditable JTextArea?" New topic
Author

The scrollbar is unable for uneditable JTextArea?

Shen Lin
Greenhorn

Joined: Mar 10, 2003
Posts: 10
Many thanks to Cindy Glass and Dirk Schreckmann. I nearly finished my program. Here is the last problem of it. I have a Frame, which merely shows how to use my GUI. I set the textarea on this frame to be uneditable and the text size outgrows the height of the frame. I, therefore, want to add vertical scrollbar to this frame. But I can't drag the scrollbar even when I set verticalScrollPolicy of JScrollPane to be JScrollPane.VERTICAL_SCROLLBAR_ALWAYS. How can I make the scrollbar available? Here is the code:
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
You have never set the policies.

You need to move them to JScrollPane from the JTextArea.

Like the above.
Shen Lin
Greenhorn

Joined: Mar 10, 2003
Posts: 10
Thanks a lot. I fixed it. (What a stupid mistake!!)
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
We all make them. Some are just more public.
 
 
subject: The scrollbar is unable for uneditable JTextArea?