Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Closing an Applet

Jon Davies
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I close an Applet using the "Exit" button, which as been evoked from another applet and placed in a frame/window? Code as follows to call the second applet from the first:
Frame externalFrame = new Frame("Tile Shuffle Game");
TileGameApplet tga = new TileGameApplet();
boolean well = false;
int width = 300;
int height = 300;
externalFrame.setSize(width, height);
Window win = new Window(externalFrame);
//try to add windows listener to close applet as follows
WindowCloser listener = new WindowCloser();
//and the I am trying to use the following to close the second applet but without much success:
class WindowCloser extends WindowAdapter
public void windowClosing( WindowEvent event )
I know that it can be done using JavaScript but I want to avoid this if possible.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!