Hi
I want to use copy/paste/cut options in my applet. how can i do these things.
:frusty:
what are the modifications needed..explain me please.
i want to copy from notepad to applet.
Printable View
Hi
I want to use copy/paste/cut options in my applet. how can i do these things.
:frusty:
what are the modifications needed..explain me please.
i want to copy from notepad to applet.
Your applet will need permission to access the System clipboard. That can be given by signing the jar file containing the applet's class files. Or you can add permissions to the .java.policy file on the PC where you are executing the applet.
what permissions i need to add for java.policy file. and i am using eclipse ide so i need to add in my project java.policy file or anywhere other than this.
I tried with selfsigning..but i am not able to access system clipboard
The permission required should be shown in the java console in the exception error message.Quote:
what permissions i need to add
You can use the policytool.exe program to edit the .java.policy file.
I am getting below exception.
java.security.AccessControlException: access denied (java.awt.AWTPermission accessClipboard)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkSystemClipboardAcce ss(Unknown So
So i added below all permissons
grant {
permission java.security.AllPermission;
permission java.security.AllPermission ;
permission java.security.SecurityPermission;
permission java.security.UnresolvedPermission;
permission java.awt.AWTPermission ;
permission java.io.FilePermission ;
permission java.io.SerializablePermission;
permission java.lang.reflect.ReflectPermission;
permission java.lang.RuntimePermission ;
};
in java.policy.applet file in EClipse IDE.
is it right. still getting same exception.
and i am using jarsigner sign below code and still not working this way also.
<genkey
dname="cn=MyThinkmap, ou=MyOrganizationUnit, o=MyOrganization, c=MyCountry"
verbose="true"
validity="365"
keystore=".mytmkeystore"
alias="lqtmdv"
keypass="password"
storepass="password" />
<!-- NOW SIGNING JAR WITH OUR SELF GENEREATED CERTIFICATE -->
<signjar jar="${config.jarfile}" keystore=".mytmkeystore" alias="lqtmdv"
storepass="password" />
thanks alot
Sorry, I have no idea what the java.policy file is and how it is used in your IDE.
I use the .java.policy file (note leading . in filename) that is used by my JRE to give permissions to my applets.
I use the policytool.exe program to update the .java.polcy file which is located in the ${user.home} folder.
On my MS Windows system the file's path is: C:\Documents and Settings\Norm\.java.policy