• Post Reply Bookmark Topic Watch Topic
  • New Topic

JtextField not showing up inside JscrollPane

 
rohit sen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone

Here is my code. When I run this, I just see a empty box without scroll bars. I think the scroll bars show up automatically as the text size increases. But I don't see the text field in the Scroll Pane. What am I missing here?





Thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use JScrollPane#setViewportView, else pass the text area in the scroll pane's constructor
 
rohit sen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked. Thanks a lot!
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!