Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30
  1. #21
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Hello,

    Its the window that warns me about the security things as I double click on the html file to open it in a browser....

    But it is basically the same thing... The applet when called in html file that open in a browser, restrict the applet to access the system files....

    Can the problem be solved by importing some security libraries in the applet...or any idea...


    Many Thanks...

    Regards

  2. #22
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,420
    Rep Power
    25

    Default

    the window that warns me about the security things as I double click on the html file
    That sounds like an OS window, not part of java. I don't know how the OS gets involved.
    Or is it from the browser? Have you signed the jar file for the applet?
    Can you screen print it and post the image?

  3. #23
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Hello...

    I dont know what you mean by "sign the jar file for applet"....

    The folder in which I have put all the files is on the desktop... and the snap shot is attched.....

    Note that I have added many files... that relates to the project... But all of them might not be neccessary....
    Attached Thumbnails Attached Thumbnails Putting the Applet program on webpage-screenshot.jpg  

  4. #24
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,420
    Rep Power
    25

    Default

    Sorry, I don't know what I'm supposed to see in the image you posted.

    Where is "the window that warns me about the security things"?

  5. #25
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    here is the scrren shot again...


    Thanks
    Attached Thumbnails Attached Thumbnails Putting the Applet program on webpage-screnn-shot.jpg  

  6. #26
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Ah Sorry....

    here is the screen shot of the window that apperas when i open the html...7


    Thanks
    Attached Thumbnails Attached Thumbnails Putting the Applet program on webpage-screen-shot.jpg  

  7. #27
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,420
    Rep Power
    25

    Default

    I don't know where that error window comes from. I don't remember seeing it before.
    The message says: "The application contains both signed and unsigned code"
    That must refer to the other jar files you are using that have signed code. Your class is the unsigned part.

    What OS are you on?

    I'm on WinXP. I use the .java.policy file on my system to give some of my applets permission to read files from other folders. There was a bit of trial and error to get it setup and working. The annoying part is that I don't know how to determine if the JVM is using a particular .java.policy file. Hence the trial and error part. Changing the file's contents and location.
    Write a small standalone applet that tries to read a file in another directory. Keep changing the policy file contents and location until the applet is able to read the file.

  8. #28
    sarwar1234 is offline Member
    Join Date
    Sep 2010
    Posts
    56
    Rep Power
    0

    Default

    Hi Norm,

    I am using windows vista....

    I found that policy file which is at the location

    C:\Program files\ Java\ jre6\lib\security\

    Then I pasted that all permission code file there... and it worked....
    Many Thanks...

    But now when i run the applet, the browse button allows me to laod the file.... But when I press the process button, no charts appers... nothing happens further.... and the console window shows this:
    Java Code:
    Java Plug-in 1.6.0_20
    Using JRE version 1.6.0_20-b02 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Logic Energy
    ----------------------------------------------------
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    
    
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
    	at OptionPanel$2.actionPerformed(OptionPanel.java:158)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)

    Any idea, why it is happening....

    Many Thanks for cooperation....

  9. #29
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,420
    Rep Power
    25

    Default

    OptionPanel.java:158)
    Is that your class? What variable at line 158 is null?

    I found that policy file which is at the location
    Which policy file? The one in the JRE's folders is NOT the .java.policy file entended for user policies.
    If you update JRE then the changes you have made to the java.policy file could be replaced with new files.
    Better to update the .java.policy file.

    Also giving applets all permissions means any applet from anywhere can do anything to you PCs files.
    Last edited by Norm; 10-05-2010 at 11:28 PM.

  10. #30
    audriusa is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Normal (unsigned) applets are just not allowed to access the file system of the client. They can only talk with the server where they are loaded from. There are no any direct workarounds: this is a security feature and workarounds would be closed as security holes when discovered!

    If your applet needs to process some input, one of the approaches would be to have a text field where the user can enter the input directly. If it is absolutely required to access the file system, signed applet needs to be used but these are expensive to have.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Putting Applet on web with images
    By Peetahzee in forum New To Java
    Replies: 1
    Last Post: 04-18-2010, 08:35 PM
  2. Putting image into program
    By SprayAndPray69 in forum Java Applets
    Replies: 1
    Last Post: 02-21-2009, 03:38 AM
  3. Putting Image into Java applet
    By SprayAndPray69 in forum New To Java
    Replies: 1
    Last Post: 02-13-2009, 06:14 AM
  4. Need help putting Exceptions in my program.
    By Loop in forum New To Java
    Replies: 6
    Last Post: 10-13-2008, 11:48 PM
  5. print webpage through applet
    By shakti singh in forum Java Applets
    Replies: 1
    Last Post: 07-22-2008, 07:17 PM

Posting Permissions

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