File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No Scroll Bar coming in JTextArea

 
shreehari Gopalakrishnan
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic