Results 1 to 8 of 8
  1. #1
    Simmy is offline Member
    Join Date
    Aug 2007
    Posts
    7
    Rep Power
    0

    Default Help with error message when running JAR via HTML file

    when i run my jar using html code it doesn't show anything... i checked the java console and the error i read was...

    java.security.AccessControlException: access denied (java.io.FilePermission book0.jpg read)
    at java.security.AccessControlContext.checkPermission (Unknown Source)
    at java.security.AccessController.checkPermission(Unk nown 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 BookMall.init(BookMall.java:63)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.security.AccessControlException: access denied (java.io.FilePermission book0.jpg read)
    at java.security.AccessControlContext.checkPermission (Unknown Source)
    at java.security.AccessController.checkPermission(Unk nown 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 BookMall.init(BookMall.java:63)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    i do use imageicon and it displays properly on my gui... but when i convert to japplet it gives all sort of error. what am i doing wrongly?

  2. #2
    levent Guest

    Default

    If book0.jpg is not on the same machine where the applet resides, you can not reach it. You just can not reach it from you applet. To access local file system of the user, you need to sign your applet..

  3. #3
    Simmy is offline Member
    Join Date
    Aug 2007
    Posts
    7
    Rep Power
    0

    Default

    how do i signed my applet?

  4. #4
    levent Guest

    Default

    Try searching on google. There are several resources to read. One of them is below:

    How to sign an applet (and get it to work)

  5. #5
    Simmy is offline Member
    Join Date
    Aug 2007
    Posts
    7
    Rep Power
    0

    Default

    ok i signed it sucessfully... the applet is showing.. but my image is not... i'm using
    picture = new JLabel();
    picture.setBorder(BorderFactory.createEtchedBorder (EtchedBorder.RAISED));
    picture.setIcon(new ImageIcon(new ImageIcon("book0.jpg").getImage();));
    getContentPane().add(picture, BorderLayout.EAST);
    what could be the problem?

  6. #6
    levent Guest

    Default

    Getting same error?

  7. #7
    Simmy is offline Member
    Join Date
    Aug 2007
    Posts
    7
    Rep Power
    0

    Default

    no there is no error... the gui is showed in the Firefox now... but the picture ain't showing... and i can't look at the console.

  8. #8
    Simmy is offline Member
    Join Date
    Aug 2007
    Posts
    7
    Rep Power
    0

    Default

    ok i found out that it will only work with IE... and when i place all the picture files on my desktop... is there a way to make it load the picture from it's current directory?(i mean the jar directory).

Similar Threads

  1. error while running jar file
    By ernieBob in forum NetBeans
    Replies: 1
    Last Post: 03-25-2008, 11:13 AM
  2. java error message
    By baileyr in forum New To Java
    Replies: 2
    Last Post: 01-23-2008, 03:47 AM
  3. Strange error message "Source not found"
    By ppayal in forum Eclipse
    Replies: 0
    Last Post: 11-25-2007, 06:19 PM
  4. how to call a JAR FILE from HTML
    By leonard in forum Java Applets
    Replies: 1
    Last Post: 08-05-2007, 06:06 AM
  5. error message on jsp
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-11-2007, 02:10 AM

Posting Permissions

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