Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applets

 
nirajju
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");
exit.addActionListener(this);
add(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
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Thanks,
Manfred.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic