wood burning stoves 2.0*
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
Author

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);
contentPane.add(scrollPane)

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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: No Scroll Bar coming in JTextArea