This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add Vertical ScrollBar whenever text is exceded visible TextArea?

 
Pradeep Kumar Raju
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Campbell Ritchie
Sheriff
Pie
Posts: 47262
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scrolling? That should be easy enough: look at this Java Tutorials page.
 
Pradeep Kumar Raju
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it but i want only vertical scrollbar & also it should be activated only if text is exceeded visible TextArea.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47262
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought you could specify which way those scroll panes scroll.
 
K. Tsang
Bartender
Pie
Posts: 3222
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JScrollPane API has setHorizontalScrollBarPolicy and setVeriticalScrollBarPolicy methods to do just that. The default is both horizontal and vertical "as needed"
 
Rob Camick
Ranch Hand
Posts: 2475
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all use "meaningful" variable names. Two character names are not meaningful.

i want only vertical scrollbar & also it should be activated only if text is exceeded visible TextArea.


That is the default behaviour when you add a JTextArea to a scrollpane.

I got it but


Post the code you used.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic