Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Question For my Applet Application how can i use system clipboard options. like copy paste,cut

    Hi

    I want to use copy/paste/cut options in my applet. how can i do these things.



    what are the modifications needed..explain me please.


    i want to copy from notepad to applet.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: For my Applet Application how can i use system clipboard options. like copy paste

    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.

  3. #3
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: For my Applet Application how can i use system clipboard options. like copy paste

    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

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: For my Applet Application how can i use system clipboard options. like copy paste

    what permissions i need to add
    The permission required should be shown in the java console in the exception error message.

    You can use the policytool.exe program to edit the .java.policy file.

  5. #5
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: For my Applet Application how can i use system clipboard options. like copy paste

    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

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: For my Applet Application how can i use system clipboard options. like copy paste

    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

Similar Threads

  1. Replies: 5
    Last Post: 05-23-2010, 05:24 PM
  2. Help!! Copy JTextField to clipboard!
    By goffy in forum New To Java
    Replies: 6
    Last Post: 05-01-2010, 07:37 PM
  3. Cut, copy and Paste in JTextPane
    By Gudradain in forum AWT / Swing
    Replies: 1
    Last Post: 01-03-2009, 06:43 AM
  4. Copy from Clipboard in japplet
    By AZMichael in forum Java Applets
    Replies: 3
    Last Post: 09-06-2008, 02:30 PM
  5. Replies: 0
    Last Post: 07-07-2008, 04:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •