James Hancock
asked on
How Do I change a URL file location on my webspace for the same file on my Desktop - for a road trip.
Hi
On my road trip, in the car, I want to work on my invulnerable chess engine, (I'll move it from my PC to my Macbook)
but my chess piece .png files are on my web-space.
How can I change a URL object to be a local file, instead?
Passing the file's location into the URL constructor doesn't work, like some pages suggested.
What actually works, without deprecated solutions?
I have working..
How do I do the same with a local file on a MacBook?
Thanks
On my road trip, in the car, I want to work on my invulnerable chess engine, (I'll move it from my PC to my Macbook)
but my chess piece .png files are on my web-space.
How can I change a URL object to be a local file, instead?
Passing the file's location into the URL constructor doesn't work, like some pages suggested.
What actually works, without deprecated solutions?
I have working..
URL url = new URL(" http://mydomain/graphicsFile.png");
pieceImages[0] = tk.createImage(url);
How do I do the same with a local file on a MacBook?
Thanks
If that's java.awt.Toolkit you're using, there's an overload of the createImage() method that takes a string filename. Barring that, you might be able to use a URL if you start it with file://, instead of http://.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)