jQuery in Action, 3rd edition
The moose likes Applets and the fly likes applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "applets" Watch "applets" New topic



Joined: Dec 01, 2001
Posts: 1
What code shall I write below:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class ExitFromApplet extends Applet implements ActionListener {
public void init() {
Button exit = new Button("Exit");
public void actionPerformed(ActionEvent e) {

// what is the code that when "Exit" Button pressed
// the applet will close itself and exit from it.
} // end class
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Unfortunately there is no such code. The applet start and finish is controlled by the browser (and or course the user). You DON"T want to use System.exit() because it will kill the entire JVM not just your applet.
You name doesn't meet the naming convention here at the ranch. Please read it here and register again.
I agree. Here's the link: http://aspose.com/file-tools
subject: applets
jQuery in Action, 3rd edition