Determine the host from where the Applet is loaded (this howto is deprecated)Tag(s): DEPRECATED
import java.applet.*;
import java.awt.*;
public class FromWhere extends Applet {
public void init() {
Label label = new Label(getCodeBase().toString());
add(label);
//
// you can check the value of getCodeBase()
// to implements a simple copy protection
// scheme. If it's not equals to your
// URL then quit.
// NOTE : This is not a very strong protection!
//
}
}
mail_outline
Send comment, question or suggestion to howto@rgagnon.com
Send comment, question or suggestion to howto@rgagnon.com