I'm writing a little photo application and I ran into some problems. I asked a question about how I could create some kind of thumbnail overview yesterday and I have finally made some progress!
I've been able to display a picture using this code:
private ImageIcon thumbs;
private DefaultListModel listmodel;
...
public void loadIntoUpperSection(File folder) {
listmodel.removeAllElements();
File[] images = folder.listFiles();
for (int j = 0; j < images.length; j++) {
thumbs = new ImageIcon(images[j].toString());
listmodel.addElement(thumbs);
}
}
However, it looks like this:
There were 17 pictures in the folder I chose but only one is visible and that one is way too big.
Where are the other pictures? is it because this one picture is too big? And how could I resize it? I've tried this but it doesn't seem to work. (I guess because of my JList's default renderer?)
Greetings