Is there a way to disable a key in a Java Applet? What I'm tring to accomplish is code an applet that will disable the "Print Screen" key on the keyboard. Any suggestions?
I have a website that I'm tring to prevent images from being copied. Using the print screen key and coping it to a paint program seems like one way of coping images without my permission.
try to add a key listener to the printscreen key and inside do nothing .
hopefully that will overide windows printkey option .
BUT!
all the user will have to do is the following ,he will enlarge the applet to maximum ,select the start bar and then press print screen so your applet isnt incharge anymore.
by uploading something to the internet you basicly declare that it is open to the public .
acctually,today with all the crackers everything is open to the public :\
so few pictures arent worth it .
I'm not sure exactly how to accomplish this task. I think you're right though by adding a key listener. In addition, I also understand what you are saying. Coding an applet for just a few images isn't worth it. I think I'll need to code the applet in the KeyPressed event. Are you sure this is possible? I haven't been doing applets for a while and been away from Java so I feel like I'm relearning (if that makes sense).
it might be possible ,but again its very easy to by pass.
all the user needs to do is to press the printscreen key while the applet isnt selected.
then the applet keylisteners arent on and windows takes control over all the keys.
besideds i dont remember i have seen the print screen key in the keys list.
You don't need to use PrintScreen to capture the screen.
The following line untidy as it might be gets the Screen Size and captures a Screen Shot which is stored in the BufferedImage.
Code:
Rectangle screenSize = new Rectangle( Toolkit.getDefaultToolkit().getScreenSize() );
BufferedImage image = new Robot().createScreenCapture( screenSize );
ps
Code:
new Robot()
may throw a AWTException so will need to be catch if u wish to implement that code.
Download the src, it takes two parameters which are how long it waits from executing the application and taking the picture, the other is what file to output it too (png file).
i know i didn't answer the exact question but i hope i made ecross aware how easy it is to by-pass the "Print Screen" key. so even totally disabling the key wont prevent people from copying the images
i do really agree with your quote Ishaibin
by uploading something to the internet you basically declare that it is open to the public.
actually, today with all the crackers, everything is open to the public :\
so few pictures arent worth it .
That seems too much for what I'm tring to accomplish. Thanks for all of your input. If you find a better solution then please let me know. I guess I'll end up putting up a privacy statement page telling people not to copy without permission and etc like you see with other pages.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.