Reputation: 474
Let's suppose I have something like:
Applet myApplet = new MyApplet();
How can I invoke that applet in a way that a new window appears, and I am still able to access that MyApplet instance from that scope?
In general, I want to be able to write code like this:
class Runner {
public static void main(String[] args) {
new Runner().run();
}
void run() {
MyApplet myApplet = new MyApplet();
myApplet.init();
myApplet.doSomething();
}
}
How can I do it?
Upvotes: 1
Views: 451
Reputation: 13535
This question is answered elsewhere, for example, at http://www.dreamincode.net/code/snippet1607.html
I found it via https://www.google.ru/search?q=java+applet+%22as+application%22
Upvotes: 1
Reputation: 11058
You have to provide an implementation of java.applet.AppletStub
to your applet. The stub provides context information that simulates the behavior of a web browser.
Upvotes: 0