i have JideButton in my code, and it is supposed to show a thumbnail of each image it links to. unfortunately, after the button is clicked, subsequent thumbnails shown will be the thumbnail that was last clicked.
this code below is from the details pane, which displays details of a record that is highlighted from the main pane.
- Code: Select all
static Image imageInstance;
Property thumbNailCell;
public void update()
{
//original image
imageInstance = getImageFromSomewhere;
//resized to fit into property pane
Image resizedImage = imageInstance.getScaledInstance(50, -1, Image.SCALE_REPLICATE);
//create a new button with the resizedImage
ImageIcon thumbNail = new ImageIcon(resizedImage);
JideButton btn = new JideButton("Expand Image "+counter,thumbNail);
btn.addActionListener(this);
counter++;
//put the button into the Property thumbNailCell
[b]thumbNailCell.setValue(btn);[/b]
}
i had set a static int counter, and had it increment each time i new the btn (JideButton). if i just browse the thumbnails of each record, the JideButton displays fine. however, if i click on the button (say it currently is a picture of an iphone), all future thumbnails will incorrectly reflect as "iphone". The counter that should show up with the text at JideButton also remains stagnant, doesn't increment. Weird enough though, the image expands out correctly in the viewer.
some help here, please?
thanks and regards,
calvin.