Hi,
I am trying to make thumbnail viewer and having problem putting the thumbnail in the proper place.
All I am trying to do is this:
iconPanel.add(iconBar, BorderLayout.NORTH);
for (int x = 0; x < 4; x++) {
iconBar.add(emptyThumbnail,BorderLayout.CENTER);
repaint();
validate();
}
Ant then whenever I scroll,
for (k = index; k < indexLimit; k++) {
JButton bt = new JButton(new ImageIcon(tmpImg));
//Add action listener to button
bt.addActionListener(this);
bt.setActionCommand(Integer.toString(k));
iconBar.add(bt, BorderLayout.CENTER);
}
But its not working, I dont see only one empty thumbnail at the start and on scroll i see 4 at time(which is fine!). But can you suggest a better layout strategy?
Thanks