tags:

views:

16

answers:

1

Hello,

I am using applet that is embedded in my web page. I am using Robot class to get client's screen as a image and send the BufferedImage using sockets. Problem is i am getting PrivilegedAccessException as soon as i do :-

Robot r = new Robot();

I don't want to force my user to change their java policies for my application. What alternatives do i have to capture client's screen?

Secondly, if i run my application directly from Netbeans 6.8 (not from web page), i get error that BufferedImage is not Serializable when i write an object of BufferedImage to socket. How to get rid of this problem?

Thanks in advance :)

+1  A: 

You'll need to create a signed jar with your applet and the permissions you need on the client machine. You can read more here. The applet will then ask the user if he/she trusts the applet before allowing it to be run.

For the serializable bit, you'll have to convert the BufferedImage to a serializable file. If you have to do that you can just as well compress it using PNG. This will speedup the transfer a lot, usually an order of magnitude.Here is more info about that.

Peter Tillemans