我有一个简单的 Applet 应用程序,我的代码从 Applet 的相同 url 创建 ImageIcon 对象。当我运行该应用程序时,我收到一条有关不受限制访问的消息,这让用户感到害怕。
如何将 Applet 或 JNLP 配置为仅显示特定限制消息?
已编辑
毕竟,我重构了我的代码并找到了正确加载图像的方法。从 JAR 加载图像: http://docs.oracle.com/javase/tutorial/uiswing/components/applet.html#images 。
要从 Applet 加载图像: imageIcon = new ImageIcon(getImage(getCodeBase(), "image/image_name.png"));
最佳答案
How I configure my Applet or my JNLP to only show specific restriction messages?
除了 JNLP API services 显示的更具体的权限之外,Java 不提供比 all-permissions、j2ee-application-client-permissions 或沙盒(没有 security 元素)更精细的权限分级)。
<小时/>然而,这个警告似乎是由于OP链接的错误而出现的。
关于java - 对 Applet/Webstart 添加较低的限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15839615/