Saving to png


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Saving to png

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    9

    Saving to png

    I'm trying to save a buffered image to a png file. I've used ImageIO.write(image, "png", file). When I run it I get "java.security.AccessControlException: access denied (java.io.FilePermission map delete)" I'm trying to save to map.png which is in the same folder as my applet.

  2. #2
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    applet's may not write to harddisk. this is a security policy. what would happen, if any applet from the internet would have write-access to your harddisc?
    make it an aplication or change your applet security policy.

  3. #3
    Join Date
    May 2006
    Posts
    22
    How do u change an applet's security policy?

  4. #4
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    usually, you have to change the java.policy file located somewhere in the jre and jsdk folders (usually jre\lib\security).
    syntax can be found at http://java.sun.com/j2se/1.3/docs/gu...licyFiles.html
    some comments on applet security can be found at
    http://www.javaworld.com/javaworld/j...-security.html
    but you only can change the policy for your computer. if you put your applet online, other users will have their own policys (which you can't modify) and thus will not be able to read/write from filesystem.

  5. #5
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    easier way is to make an application from your applet.

  6. #6
    Join Date
    Jun 2006
    Posts
    9
    Well I don't know how to make an application, nor do I have the intention. However, I did find a tutorial at http://java.sun.com/developer/techni...curity/Signed/ for applets. I tried following it, but it seems my computer can't find the command 'keytool', along with several other vital commands. Why is this?

  7. #7
    Join Date
    Feb 2006
    Location
    Cologne - Germany
    Posts
    271
    keytool is located in the jdk\bin folder. perhaps you didn't configure the PATH variable properly.

  8. #8
    Join Date
    Jun 2006
    Posts
    9
    I got keytool to work eventually. For enabling file access I made a jar file of my project, and ran "keytool -genkey" to make a key thingy. Then I ran "keytool -selfcert" to make the certificate and then -jarsigner to sign the jar file with the certificate. However, this still does not let it open the file. Why is this?

Similar Threads

  1. Saving data in a binary file
    By teja8100 in forum VB Classic
    Replies: 6
    Last Post: 07-08-2005, 06:03 PM
  2. Replies: 1
    Last Post: 05-15-2005, 09:31 AM
  3. saving file name
    By Jazson in forum Java
    Replies: 0
    Last Post: 03-10-2003, 09:29 AM
  4. Saving Object Hierarchies
    By Richard Dalton . in forum Architecture and Design
    Replies: 14
    Last Post: 12-29-2000, 12:41 AM
  5. saving a rst to a db
    By Ralph Carrasquillo in forum VB Classic
    Replies: 1
    Last Post: 05-11-2000, 01:55 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
  •  
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