Solved

Terminating an applet.  Simple question

Posted on 2000-02-16
8
240 Views
Last Modified: 2006-11-17
I have a quick question about applets.  Is it possible to terminate the executions of an applet once a browser has loaded it?  I'm not talking about
the stop() method because that just postpones the applet.  I want the applet to completely terminate.  I've tried using a

System.exit(0);

command but that doesn't seem to work.  Am I using this call wrong or doesn anyone know of anything else I could try?
0
Comment
Question by:CatDevlp00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 1

Accepted Solution

by:
swwong earned 70 total points
ID: 2528125
Are you meaning free the system resources for the applet?

Try

setVisible(false);
dispose(); //Free the system resources
System.exit(0);
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2528134
you can't 'terminate' applet (or browser window). but you can stop all your threads, disable / remove all the UI and stop handling user events.
0
 

Author Comment

by:CatDevlp00
ID: 2528287
swwong,
I mean to terminate the applet, meaning to stop it from running.  Freeing up system resources would also be part of this process.  Is it possible to terminate an applet once it starts running?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:heyhey_
ID: 2528322
what is TERMINATE ?

you can't KILL the browser window
0
 

Author Comment

by:CatDevlp00
ID: 2528470
I don't wish to kill the browser window, I want to kill the applet which is running under the browser window when a certain button is clicked on the applet.
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2528503
just claer all yout UI and STOP RESPONFING.

applet can't be more DEAD than this.
0
 
LVL 1

Expert Comment

by:swwong
ID: 2529754
I do agree with heyhey. If you want to kill an applet, the most simple thing is to kill your browser window. Otherwise, you can just clear up those UIs and free up all the memory resources. And I think it's enough already. Actually, why you want to really "TERMINATE" an applet, and what kind of level for the termination do you want? Please let us know more.
0
 

Author Comment

by:CatDevlp00
ID: 2531345
We're creating a very high level applet which runs an on-line database of sorts.  When a user finishes using the applet, we'd like it to stop running completely, like the end of a program on a single PC.  Thus we wanted complete termination of the applet, as when a PC based program finishes execution.  
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question