Esempio n. 1
0
  protected Applet createApplet(final AppletClassLoader loader)
      throws ClassNotFoundException, IllegalAccessException, IOException, InstantiationException,
          InterruptedException {
    String code = getCode();

    if (code != null) {
      applet = (Applet) loader.loadCode(code).newInstance();
    } else {
      String msg = "nocode";
      status = APPLET_ERROR;
      showAppletStatus(msg);
      showAppletLog(msg);
      repaint();
    }

    // Determine the JDK level that the applet targets.
    // This is critical for enabling certain backward
    // compatibility switch if an applet is a JDK 1.1
    // applet. [stanley.ho]
    findAppletJDKLevel(applet);

    if (Thread.interrupted()) {
      try {
        status = APPLET_DISPOSE; // APPLET_ERROR?
        applet = null;
        // REMIND: This may not be exactly the right thing: the
        // status is set by the stop button and not necessarily
        // here.
        showAppletStatus("death");
      } finally {
        Thread.currentThread().interrupt(); // resignal interrupt
      }
      return null;
    }
    return applet;
  }