• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need advice, scrolling list of images

 
Author
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create something like Window Explorer's "thumbnail" view where If a directory has say 200 images I'll display only the first N which will be visible and as the user scrolls the others are displayed. I already know how to generate the images and display them but I'm looking for some advice on how I would implement this scrolling features. Anyone ever work on something like this?
 
Marshal
Posts: 79475
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you put all your 200 pictures into a JScrollPane?
 
Michael Remijan
Author
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that is what I have done. I have a JPanel inside a JScrollPane. The JPanel has a GridBagLayout. When I click on a directory a thread start which starts resizing the images and putting them into the JPanel; 3 column by how ever many rows are needed. With 200 images I sit there and watch the slowly watch as all the thumbnails are generated and it all works fine but I don't want to sit there for so long. What I'd like to do is to just generate however many images will actually be visible and when the user scrolls then the other thumbnails are generated. This will make the app more interactive instead of just sitting there waiting for all the thumbnails to be generated.
 
Campbell Ritchie
Marshal
Posts: 79475
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know a lot about images, but I do know that resizing graphics and pictures strains the chip. It is about the only thing which will make your chip break into a sweat.

Is it possible to resize your pictures at initialisation time, resave them as new .gif files, and then load them as thumbnails?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic