swing - How to set java.awt.awtpermission in policy file? -


my code getwaitmessagebox().setalwaysontop(true);.

this throws

java.security.accesscontrolexception: access denied (java.awt.awtpermission setw indowalwaysontop) @ java.security.accesscontrolcontext.checkpermission(unknown source) @ java.security.accesscontroller.checkpermission(unknown source) @ java.lang.securitymanager.checkpermission(unknown source) @ java.awt.window.setalwaysontop(unknown source)

so need set awtpermission in policy file "setalwaysontop".

how can add policy file?

the "default policy implementation , policy file syntax" explains syntax of policy files. syntax here.

the "permissions in java™ se 7 development kit (jdk)" document lists of standard permissions. permissions awt listed here.

from these can deduce permission should set follows:

    permission java.awt.awtpermission "setwindowsalwaysontop"; 

the permission target confirmed javadoc.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -