Forums Register Login

images in JList

+Pie Number of slices to send: Send

Hi there,

I made an applet and added a JList object into it and I have a folder containing images (0.jpg, 1.jpg, 2.jpg)

I want to add these images in the JList object in the form of loop when I tries this



the list resulted in list of object reference not image itself
so is there any solution for this issue

and thank you very much
+Pie Number of slices to send: Send
Add ImageIcon's to the ListModel, not Image's.

+Pie Number of slices to send: Send
so how can I select from the ListModel certain icon to get the image and save it to folder or database
+Pie Number of slices to send: Send
"nesrin ab", please check your private messages for an important administrative matter.
+Pie Number of slices to send: Send
Read the ImageIcon API.
+Pie Number of slices to send: Send
I tried another solution but also failed
please if any one can help me




+Pie Number of slices to send: Send
in the last one there is no exception thrown but the images do not appear in the list
+Pie Number of slices to send: Send
 

I tried another solution but also failed



Why? I already gave you the solution.
+Pie Number of slices to send: Send
can you give a sample code,
I tried your solution, but I have no experience with applets and failed to do it
so if you can write the sequence that is should follow to use the ListModel and ImagIcon
+Pie Number of slices to send: Send
> I made an applet
> images[i] = ImageIO.read(new File(path));

won't work in applets

google
getCodeBase()
+Pie Number of slices to send: Send
why Michael
and where to add the getCodeBase()
+Pie Number of slices to send: Send
 

but I have no experience with applets



Well, thats an important piece of information to leave out (that this is for an applet).

Read the section from the Swing tutorial on How to Make Applets for an example of using images in an applet.
+Pie Number of slices to send: Send
Thank you all very much.
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1740 times.
Similar Threads
Displaying image in applet on click event
Problem with the JScrollPane
Tricky NullPointerException Problem
Image Overlapping not proper
append multiple jpg images to form multipage jpg Image
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:05:38.