Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JScrollPane help  RSS feed

 
Peter Kirk
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to load a lot of thumbnails onto a JPanel, which is in a JScrollPane. The problem I am having is that the scroll pane does not generate a vertical scroll bar as the thumbnails increase beyond the visible screen size. I don't want horizontal scroll, only vertical if necessary.

Here is some example code. In reality, I'm loading a lot of different thumbnails. In ths example I just have one (100x150 pixels) which I load 100 times.



Thanks,
Peter
 
Rob Camick
Ranch Hand
Posts: 2753
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the Wrap Layout.
 
Peter Kirk
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:Use the Wrap Layout.


Excellent! Amazing you have made the exact layout I needed :-)
I notice you don't have a package name in your class file, so I've called it "rob.camick.layout" in my project - hope that's ok!

/Peter
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!