File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

right click on the browser

 
shipra sarkar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a image on my html page.I want the copy option to be disabled when the user right clicks on the image in the html page.
how can that be done
please help
 
ken chou
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I know you can use Javascript to do that. If it's just a html page, not java applet, I doubt about you can do it in Java.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply pass the image into the applet and do a g.drawImage( image ) in the applet's paint method... the user then cannot right click on the image and save it, since they are not clicking on an image anymore, but a Java applet. However, this does not stop someone from simply viewing the code of your webpage or your applet to find the filename of the image and downloading it directly. You may be able to put your images in a non-public directory to prevent this, but then I am not sure if the applet could access them either.
However, Ken's suggestion is probably right... this is probably better suited to JavaScript than Java...
And here's another question... if you don't want users to download an image, why are you putting on the internet? Every time a browser connects to your page, that image is downloaded to the users computer anyway... they just have to wade through all the browser files to find it... and as long as an image is displayed on the screen the user can take a screenshot and save your image that way...
HTH,
-Nate
 
ken chou
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I totally agree with Nathan. I keep wondering the reason why you are trying to do that when I read your question?
[This message has been edited by ken chou (edited April 18, 2001).]
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic