File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes No Scroll Bar coming in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "No Scroll Bar coming in JTextArea" Watch "No Scroll Bar coming in JTextArea" New topic

No Scroll Bar coming in JTextArea

shreehari Gopalakrishnan
Ranch Hand

Joined: Jun 01, 2004
Posts: 30
Hi Masters

for my new project i have to make a file finder which is just like windows "Find files " for that i have placed a JTextField for File name
a JComboBox for Drives selection and a JTextArea for listing of resulting file names
The problem is there is no scroll bar coming for JTextArea

I have put

JScrollPane scrollPane = new JScrollPane(txtFind);

But it is not working if i did like this no TextArea is displaying

if i add

contentPane.add(txtFind) then TextArea is displaying but no scroll bars

Can any one help me?
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281

This works on my desktop. Note, though, that I have asked for a 5 by 5 JTextArea and what I get with the JFrame default layout is a text area that completely fills the frame. If you just start typing the characters will show. If you press the enter key enough times then you will get to the bottomm of the screen and the vertical scroll bar will appear.

Hope that helps

The nice thing about Standards is that there are so many to choose from!
I agree. Here's the link:
subject: No Scroll Bar coming in JTextArea
It's not a secret anymore!