When I try to run an applet in applet viewer it is not able to find resources (Image). I try to load resource like this:
String cb= this.getCodeBase().toString();
String imgPath = cb+"com/blah/Images/a.png";
System.out.println("imgPath:"+imgPath);
java.net.URL imgURL = Applet.class.getResource(path);
but when i run it in appet viewer path is like this: imgPath:file:D:/Work/app/build/classes/com/blah/Images/a.png
though image is there in this path, is prefix file: causing problem, how can i test this code?
Will this code work when deployed in server and codebase returns a server URL?