wood burning stoves 2.0*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
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: 37938
    
  22
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: 37938
    
  22
I thought you could specify which way those scroll panes scroll.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2231
    
    7

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 OCPJP7 OCPWCD5
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2152
    
    7
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
 
subject: How to add Vertical ScrollBar whenever text is exceded visible TextArea?
 
Similar Threads
How to know which key is pressed from keyboard using ActionListener or KeyListener?
Remove menu item when internal frame is closed
null Pointer Exception
Calculator Problem
Dynamic building of Jmenu