java applet

Status
Not open for further replies.

oryp

Seniorius Lurkius
12
Hi ...How do i link a java applet to a file on my computer and not a web page ..
eg: <applet CODE="rollOver.class" WIDTH="341" HEIGHT="90">
<param name="imgOff" value="Image2.gif">
<param name="imgOn" value="Image22.gif">
<param name="HLink" value="http://www.javafile.com">
</applet>

i dont want it to go to www.javafile.com but say ...c:/windows/mymusic.vbs

but i dont know how to link it to a file ?
thanx
 
D

Deleted member 43669

Guest
Errrm... if you want someone else's computer to access a file on your hard disk, you'll have to put the applet on a web server or similar so that it can be found via a 'global' URL.

If all you want is to test the applet in your computer inside of a webpage, I guess you could load your applet using the 'open file' functionality of your browser, note the file://... url and put that in your html.

You might also want to try appletviewer instead. It is contained in the jdk.

EDIT: on a second read, I see you want the applet to access a file on your computer, silly me. You'll want to put the file on a web server or similar (only read access for a web server, an ftp server would let you write), write a server app (or use rmic or something), to communicate the applet with your computer or something else.
 
Applets run via a web browser run in a sandbox. That is, they can't touch anything except basic sound and basic graphics on the users computer. Only signed applets can run stuff outside the sandbox and only after the user agrees to it (It's one of those "Always trust content from ..." type things).

There's a Java tutorial on Signed Applets on the website.
 
Status
Not open for further replies.