How to replace image?

Hi people out there, me facing a problem on replacing the image.

I have a array of images. When i double clicked any of the image, there will be a file chooser appeared. This allows the user to choose another picture to replace the current image. So how to replace that particular image?

Please help. Thanks.

* Nuts_gal *

[348 byte] By [Nuts_gala] at [2007-10-1 0:50:59]
# 1
How is the current image displayed?
mlka at 2007-7-8 1:06:34 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 2
Actually this is how it works:1. First, the user will select a text file and a folder where all the images are store 2. Then it will generate an array of images and the particulars that took from the text file.So the current image displayed is by array...
Nuts_gala at 2007-7-8 1:06:34 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 3
But how is it show on the screen at the moment? JLabel maybe?
mlka at 2007-7-8 1:06:34 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 4
ya.. by JLabel
Nuts_gala at 2007-7-8 1:06:34 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 5
So anything in the JLabel API [ http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JLabel.html ] look like it will change the image ( like say setIcon?)
mlka at 2007-7-8 1:06:34 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 6
But now my problem lies is, my images are in array. i still cant figure out which image the user choose to replace the picture. For example: i have x no of images. How sld i nod which image i click.. if is [0] or [9] or [27] and etc.
Nuts_gala at 2007-7-8 1:06:34 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...