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.

[380 byte] By [DEV_FORUM_Screena] at [2007-10-3 3:15:26]
# 1

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

omcgoverna at 2007-7-14 21:06:47 > top of Java-index,Security,Cryptography...
# 2

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

DEV_FORUM_Screena at 2007-7-14 21:06:47 > top of Java-index,Security,Cryptography...