TVApplet to application
I'm trying to trasform TVApplet.java to an application program.
I've problem to locate the .avi file ...
java.net.URL url = getClass().getResource("/home/lando/calcio.avi");
System.out.println("pointer" + url);
....the url is null !
this code shouldn't work ? (till now I've used it for images...now for an avi file...)
Many thanks.
getClass().getResource() uses the classloader to resolve the resource.
So,
a) You should have a directory structure called "/home/lando" on your PC
and its parent directory should be on your classpath
Eg.
/myapp
/myapp/home/lando
Your classpath should include /myapp
All directories should be case sensitive too.
regards,
Owen
The main error was that parameter to getResource have to be only
the filename....without path (I put the path!) !java.net.URL url = getClass().getResource("/home/lando/calcio.avi");
And,as you say, the file have to be resident on the defined classpath.....
The response isfile:/home/lando/JMF-2.1.1e/lib/calcioMO.avi
Thanks