aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes HELP: getImage(url) stopped working (was okay)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "HELP: getImage(url) stopped working (was okay)?" Watch "HELP: getImage(url) stopped working (was okay)?" New topic
Author

HELP: getImage(url) stopped working (was okay)?

achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Hi, all.
I've been using this piece of code successfully, with only minor variations.
Basically an applet passes two parameters of type (URL, string) to a helper class.
Then on this particular variation of the code, I got this error:

and here is the code snippet for it

Why is this so?
Any hints and pointers appreciated.
TIA :-)


humanum errare est.
saager mhatre
Ranch Hand

Joined: Dec 20, 2000
Posts: 61
Strangely enough, I don't see a method in either of your classes.
In what context did you use the method before? Did you define it any of your other classes? If yes, you might need to qualify the method call as you seem to have moved out of context!
If you are expecting an API method,
As evident from the JDK API docs, only one method with this signature exists and that is . Were you working on Applets previously, 'cause you've moved to a JFrame now!
You might want to consider other techniques now such as

...OR...
Using a dummy Applet member in your Frame to retrieve Images instances (though this approach could run aground if the platforms AppletContext doesn't support creating Images from an Orphan Applet!).
achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
Thank-you very much for your advice and taking time to look at my issue.
Yes, I was working with applets. I got the url in the startup applet (the one extending JApplet) and passed the url on as parameters to other applets (those not extending JApplet).
It is the first time I hear about the potential issue with "orphaned applets", and I am not convinced that one cannot access one's own image files in this manner. There might be legitimate reasons for it, but from where I see it, it seems over done.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HELP: getImage(url) stopped working (was okay)?
 
Similar Threads
Swing Background Picture
Accessing image files in an applet
Display image in a BorderLayout
getImageIcon() : how does it work?
Copy Picture (Image)