我想要java代码中的某个地方:
if(inAnApplet()) {
initForApplet();
} else {
initForApp();
}
最佳答案
public class MyApplet extends JApplet {
boolean isapplet = true;
public MyApplet() {
this(true);
}
public MyApplet(boolean isapplet) {
this.isapplet = isapplet;
}
public static final void main(String[] argv) {
// is an app
new MyApplet(false);
}
}
关于java - 测试java代码是否在applet中运行的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8526245/