You can determine the host from where an Applet is loaded using getCodeBase() method.

An example usage is implementing a simple copy protection scheme. If the retrieved codebase does not equal to your predefined host then you can quit.

 import java.applet.*;

public class MyApplet extends Applet {
  public void init() {
    System.out.println(getCodeBase());
    //
    // you can check the value of getCodeBase()
    // to implements a simple copy protection
    // scheme. If it's not equals to your
    // URL then quit.
    //
    }
  }