• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Copy Paste Applet

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greeting all.

I've been working on some applet that uses
Clipboard to paste data to other programs in the system.

I've been using the Eclipse enviorment.
so everything works fine on Eclipse, but when I planet the Applet
inside .html, the Applet doesn't work and on Java Console I see

java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard) ...

The problematic line in my code seem to be:

Clipboard clipboard = getToolkit().getSystemClipboard();

Is something can be done?
The purpose is that the Applet will work for the regaler user without
having to tweak the user's Java security options...

Many Thanks.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

If you can't (or don't want to) fiddle with the user's setup you'll have to sign the applet. Then the user only has to accept your certificate, and that's it. See HowCanAnAppletReadFilesOnTheLocalFileSystem for more detail.
 
blingo james
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,
Will look into it...
 
blingo james
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It worked,
After looking at the above,
I've used http://ww2.cs.fsu.edu/~steele/SECURITY/appletSecurity.html

From what I understand,
every time an applet do something that has to do with security,
it needs to be signed, is that correct?
 
blingo james
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another thing, wasn't sure if to ask it here or open a new thread,
I've used keytool once to create a certificate, just to see if it works
by

keytool -genkey -dname "cn=Trusted Developer" -validity 365 -storepass SecretStorePassword -keypass SecretKeyPassword

now I want to create a new certificate that will contain other information than cn=Trusted Developer but I can't, it writes stuff like:

keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect

What should I do?

Many thanks.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

From what I understand, every time an applet do something that has to do with security, it needs to be signed, is that correct?[/QB]


Yes. A (possibly incomplete) list of what that means can be found in section 2 at http://www.securingjava.com/chapter-two/

keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect


Make sure you delete the old keystore before creating a new one.
 
blingo james
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Worked.
Thanks, You guys are the best.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic