Forums Register Login

Reading and displaying an image

+Pie Number of slices to send: Send
How can In read and display an image using Java.And,what must the image path be in this case?

Thanks.
+Pie Number of slices to send: Send
 

Originally posted by Abder-Rahman Ali:
How can In read and display an image using Java.And,what must the image path be in this case?

Thanks.



Usually you use the Toolkit#getImage() method to retrieve the Image object. Then based on the requirement you can either use it directly or wrap it inside an ImageIcon and then use it.

The image path can be a String indicating the file, or a URL.
Do take a look at this article. especially the part regarding loading images. You might find it useful.
Ruth Stout was famous for gardening naked. Just like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 681 times.
Similar Threads
converting png to tiff and character recognition with tesseract
Loading image file
Unsupported Color Conversion Request
Easy one
Getting rid of Java Icon on the upper left hand corner
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:51:14.