Hello,
I have a Swing window that has sensitive information in it and I would like to prevent users from taking screenshots, or making by window invisible when they do take the screenshots.
How can I achieve this?
Hello,
I have a Swing window that has sensitive information in it and I would like to prevent users from taking screenshots, or making by window invisible when they do take the screenshots.
How can I achieve this?
If someone tried to do this I would run their program in a VM, and then take a screenshot of the VM screen.
So there is no way you could prevent something like this... and why should you?
One clever approach I have seen in the past takes advantage of human's persistance of vision by display only a portion of the image at a time.
As a simple example, imagine that instead of rendering the password 'p455w0rd' in a textbox, you had a special text box that renders three different frames very quickly:
p ␣ ␣ 5 ␣ ␣ r ␣
␣ 4 ␣ ␣ w ␣ ␣ d
␣ ␣ 5 ␣ ␣ 0 ␣ ␣
Any screenshot would only capture a portion (1/3) of the data and would require that the capturer take many screenshots, select three that encompass all of the information and then combine them in an image editor to recover the data.
A better solution would use more frames (though flicker will increase as the number of frames increases) or finer granularity (pixels, say, instead of characters).
Remember, though, that this solution just makes it harder, not impossible to store the data. You would be hard pressed to stop the user whipping out a pen or camera. Unless this is for some government or call-centre application that is attempting to protect customer data, I would seriously consider not adding such a feature.
Ubnfortunatly, you won't be able to do so in an efficient fashion.
First, operating system don't seems th send event when they take screenshots (which could have given you a handle - or an event).
Sceond, user can always run your application in a VM (preventing the vent from being sent) or, both worse and easier, take a picture with a cameraphone or any other device.
Finally, what is the point of showing informations that the user can see but not memorize ? If you want your informations to be hidden, don't show them to the user, otherwise he will always be able to copy them (think about the entertainment industry and the issues about DVD screeners, as an example).
Finally, if you want to give your boss some positive information, take a look at jintellitype, which will allow you to register a listener for the "Print screen" key.