aspose file tools
The moose likes Swing / AWT / SWT and the fly likes How to add Vertical ScrollBar whenever text is exceded visible TextArea? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to add Vertical ScrollBar whenever text is exceded visible TextArea?" Watch "How to add Vertical ScrollBar whenever text is exceded visible TextArea?" New topic
Author

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

Pradeep Kumar Raju
Greenhorn

Joined: Mar 10, 2013
Posts: 20
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32833
    
    4
Scrolling? That should be easy enough: look at this Java Tutorials page.
Pradeep Kumar Raju
Greenhorn

Joined: Mar 10, 2013
Posts: 20
I got it but i want only vertical scrollbar & also it should be activated only if text is exceeded visible TextArea.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32833
    
    4
I thought you could specify which way those scroll panes scroll.
K. Tsang
Ranch Hand

Joined: Sep 13, 2007
Posts: 1260

The JScrollPane API has setHorizontalScrollBarPolicy and setVeriticalScrollBarPolicy methods to do just that. The default is both horizontal and vertical "as needed"


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1808
    
    2
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to add Vertical ScrollBar whenever text is exceded visible TextArea?
 
Similar Threads
Dynamic building of Jmenu
How to know which key is pressed from keyboard using ActionListener or KeyListener?
Calculator Problem
null Pointer Exception
Remove menu item when internal frame is closed