This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Applets and the fly likes Detect loading of ImageIcon from URL? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Detect loading of ImageIcon from URL?" Watch "Detect loading of ImageIcon from URL?" New topic
Author

Detect loading of ImageIcon from URL?

Barclay Berger
Greenhorn

Joined: Jun 07, 2006
Posts: 6
I'm pretty new to java, I'm trying to detect if an image gets loaded or not, don't know how to do that. I thought by catching the url command it would do it but if you link to an image that doesn't exist it doesn't throw and exception. How can I either detect if url was correct or if icon exists? Thanks

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35252
    
    7
As is explained here, you should first verify that the URL is valid. Additionally/alternatively you can provide an image observer to get more information about the loading process via the ImageIcon.setImageObserver method.


Android appsImageJ pluginsJava web charts
Barclay Berger
Greenhorn

Joined: Jun 07, 2006
Posts: 6
Thanks, I'll try the url stuff first, other is above my head
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Detect loading of ImageIcon from URL?
 
Similar Threads
tray icon is not displaying
Adding a background image
Adding an Image to a Panel
A few problems with the Custom Cursor
Problems loading images from application JAR