DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: JApplet Problem

  1. #1
    Join Date
    Apr 2005
    Posts
    9

    JApplet Problem

    Hi,
    I'm using the Ready to Program IDE to program an applet using Swing components (JApplet, etc). It works fine when I run it with RtP, but when I run the HTML file, it keeps telling me that it failed to load the class.
    Here are the messages that I get when viewing the Java console:

    java.security.AccessControlException: access denied (java.io.FilePermission rock.gif read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkRead(Unknown Source)
    at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
    at sun.awt.SunToolkit.getImage(Unknown Source)
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at RockPaperScissors.init(RockPaperScissors.java:37)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    Can anyone help me with this?

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Looks to me like you are trying to read a file locally, on a client's computer, - that
    is, in a web browser. You can't do that.
    eschew obfuscation

  3. #3
    Join Date
    Apr 2005
    Posts
    9
    So are you saying that if I upload the entire thing (along with the pictures) onto a webserver, it'll work fine?

  4. #4
    Join Date
    Apr 2005
    Posts
    9
    Nevermind, the problem was fixed using URL and java.net.

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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