0

I am trying to make an image Viewer like the one shown in the figure below:-

enter image description here

Before i can start i have following questions in mind :-

  1. How would i check for the number of images in the target folder so that i can iterate and include all the images in my app.

  2. Secondly,i am thiking to scale the images down to 75x75 .But what i can't think is that how will i slide the images as scrollbar is moved To be specific,what is the appropriate container for those 75x75 images queue and how that queue is shifted to left or right?(I already know how to get current scrollbar value and add event listeners on it to respond)

mKorbel
  • 108,320
  • 17
  • 126
  • 296
Insane Coder
  • 6,859
  • 11
  • 62
  • 140
  • 2
    This is two questions in one, and the first is something even google can answer, or you could just look it up in the [Java API docs](http://docs.oracle.com/javase/6/docs/api/java/io/File.html#listFiles())... Also, the second question implies one: What have you tried? – ppeterka Oct 31 '12 at 15:05
  • 1
    Did you find anything in the [Swing tutorial](http://docs.oracle.com/javase/tutorial/uiswing/components/index.html), the [javax.swing](http://docs.oracle.com/javase/7/docs/api/javax/swing/package-summary.html) documentation, the [SwingSet3](http://download.java.net/javadesktop/swingset3/SwingSet3.jnlp)? – ignis Oct 31 '12 at 15:16
  • 1
    A `JList` might be a good vertical scrolling component for the images, as seen in [this answer](http://stackoverflow.com/a/9544652/418556). – Andrew Thompson Oct 31 '12 at 15:16

2 Answers2

2

To check the number of images in the target folder you can use the File class.

As for the container you might need to create the animation your self. There is no a container ready for doing so.

This site ( and book ) has some ideas about it. I don't know how out-dated it might be though

http://filthyrichclients.org/

OscarRyz
  • 184,433
  • 106
  • 369
  • 548
0

Unless I am misunderstanding, making a scrolling list of images is quite simple.

First, create a JList with a datamodel that allows images.

A great example is shown here: Java drag and drop images in a list

Second, add the JList to a JScrollPane.

The scaling aspect can be easily performed using Scalr: http://www.thebuzzmedia.com/software/imgscalr-java-image-scaling-library/

Community
  • 1
  • 1
NoUserException
  • 600
  • 5
  • 11