Find the answer to your Linux question:
Results 1 to 4 of 4
Hiya, Could anyone possibly tell me how I could go about testing a java applet in a web browser before deploying it? I have a short application I want to ...
  1. #1
    Linux Newbie hughitt1's Avatar
    Join Date
    Oct 2005
    Location
    Baltimore, MD USA
    Posts
    167

    Testing Java Applets in a Browser

    Hiya,

    Could anyone possibly tell me how I could go about testing a java applet in a web browser before deploying it? I have a short application I want to test, but I cannot get it to work in Firefox.

    When i try to run it either locally, or through apache, I get the following output in the Java console:

    Code:
    java.security.AccessControlException: access denied (java.io.FilePermission image/logo.gif read)
    	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    	at java.security.AccessController.checkPermission(AccessController.java:427)
    	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    .
    .
    .
    I Tried checking the firefox security settings and java is enabled. I could not find anyplace to let it know that its okay to work with files. I Also tried checking google but have not had any luck just yet.

    Anyone have any suggestions?

    Thanks,

  2. #2
    Linux Guru bryansmith's Avatar
    Join Date
    Nov 2004
    Location
    /Ontario/Canada
    Posts
    2,621
    Are you positive your code is good? It seems as if you are having some permission problems.

    Have you tried appletviewer to view your applets (it comes with the sun jre)?
    Looking for a distro? Look here.
    "There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
    Queen's University - Arts and Science 2008 (Sociology)
    Registered Linux User #386147.

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I seem to recall that Java applets cannot access any files...

    Aha. From the Java Sun FAQ (Applet Security):
    3. How do I let an applet read a file?

    Applets loaded into a Java-enabled browser can't read files.

    Sun's appletviewer allows applets to read files that are named on the access control list for reading.
    EDIT:

    This seems to refer only to the remote system. Try adding the image into the JAR file itself and see if you can access it that way.
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Linux Newbie hughitt1's Avatar
    Join Date
    Oct 2005
    Location
    Baltimore, MD USA
    Posts
    167
    Okay. I did try the
    Code:
    appletviewer
    and it was able to run the applet, however the appearance of the GUI was distorted, and some of the buttons were unaccessible, so i gave up on it. I Will check out the post, and also try loading the images into a .jar file.

    Thanks for the input!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...