使用Java Applet的Phidg​​ets

时间:2013-04-23 02:55:03

标签: java security applet accesscontrolexception

我正在尝试将phidget接口工具包附加到我的applet,它给了我这个错误:

java.lang.ExceptionInInitializerError
    at AppletTest.init(AppletTest.java:15)
    at sun.applet.AppletPanel.run(AppletPanel.java:434)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "loadLibrary.phidget21")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
    at java.security.AccessController.checkPermission(AccessController.java:555)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at java.lang.SecurityManager.checkLink(SecurityManager.java:835)
    at java.lang.Runtime.loadLibrary0(Runtime.java:839)
    at java.lang.System.loadLibrary(System.java:1084)
    at com.phidgets.Phidget.<clinit>(Phidget.java:26)
    ... 3 more

我在phidget论坛上问过,没有回答。有没有人对小部件有任何经验并且知道发生了什么?

网站:http://www.phidgets.com/

我的代码:

import java.applet.Applet;
import com.phidgets.*;
import com.phidgets.event.*;
import java.awt.*;

public class AppletTest extends Applet implements Runnable
{
  private InterfaceKitPhidget ik;

  public void init()
  {

     try
     {
        ik = new InterfaceKitPhidget();
        ik.openAny();
        System.out.println("Waiting for interface kit attachement..");
        ik.waitForAttachment();
     }
        catch (PhidgetException e)
        {
           System.out.println("Phidget Exception");
        } 

  }

  public void start()
  {
  }

  public void stop()
  {
  }

  public void destroy()
  {
  }

  public void paint(Graphics g)
  {
  }

  public void run()
  {
  }
}

0 个答案:

没有答案