DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002

    directing java buttons to file on my hard drive

    I am have learned some basic HTML recently and I am trying to incorporate some Java Applets. So far I’ve been pretty successful. I have hit a small problem because I have not read anything on Java itself. I am writing my code to work on my computer with my web pages so all of my files are local. I need advice on the following code:

    *<param name="Link" value="http://www.codebrain.com">
    <param name="Target" value="_top">

    This code is for a navigation button. I am trying to link it to a new page. This would be asteroids.htm (a java asteroids game that would be on my hard drive, not at someone else’s site or my own since it’s all offline for now. Regarding the line I put an * in front, it works fine for any url. But when I say value=”asteroids.htm”, I get no action. The file I am directing the value to is in the same directory as the code above. Right now I am pretty much doing the whole site in one directory. I know in HTML <a href=”asteroids.htm”> link </a> would point my browser to the appropriate file just fine. In Java though, this doesn’t seem to work. I tried changing the param name= to “file”—I thought I might just get lucky but…not. This sight will probably never go live so I need to figure out how to make the code work on my system. I am also aware that Java is case sensitive. I also tried making the value C:\\WINDOWS\Profiles\Steve…etc. to point it to the exact location on my hard drive. That didn’t work either.

    Let me know if you’ve got the answer. Thanks.

    Steve, the wannabe programmer

  2. #2
    Join Date
    Aug 2002

    Java cannot read files fromyour hard disk - the default security model prevents that for obvious reasons.

    You will have to extend the security model to acheive that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.