Re: Creating an image file from a Java Applet
Saturday, May 13, 2006 08:21 AM
This won't get you the full way there, but you need to invoke the "paint(Graphics g)" on an Image object instead of (or in addition to) the Applets display. From there, you should be able to get a binary representation of the image. (This is where you need more homework.) One important thing to note, though, is that an Applet is effectively sandboxed from doing anything to the client's filesystem (read or write)... you can "sign" the applet (not strictly required) and the client can modify the security policy of their JRE to allow filesystem writes (possibly only if an applet is signed by a given person), but this would have to be done by any person running the applet ... you could only provide instructions to the client/user, and then they may need to have administrator access to the JRE's security policy file.