Any workaround to getting Copy/Paste working in JDK 7 AWT Applet on Mac?

前端 未结 3 1741
情话喂你
情话喂你 2021-01-15 06:59

Since Apple forced the update to JDK 7 on Mac, old AWT applets no longer support copy/paste. For example, if you visit:

Simple AWT Textfield Example

you cann

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-15 07:11

    Here is a great and very detailed walk-through to do it the official Java way using their policy tool:

    http://www.shodor.org/interactivate/resources/InstructionsCopyPaste/

    Here is a quick summary of the instructions:

    1. in Terminal.app type "policytool" and hit [Enter]
    2. dismiss any error message and choose "Save" from the "File" menu
    3. save as ".java.policy" (with a preceding dot) in your user's home directory
    4. click "Add Policy Entry" and then "Add Permission"
    5. choose "AWTPermission" as the permission and "accessClipboard" as the target
    6. click "OK", then "Done"
    7. choose "Save" again, then "Exit" from the "File" menu
    8. restart your browser (or your computer if copy/paste still doesn't work)

提交回复
热议问题