-   Programming (
-   -   Java Applet (

ekl_n 02-25-2005 08:02 PM

Java Applet
I'm a beginner in Java programing.

I would like to know how the close the applet with the "Exit" button I have created to allow the user to close the applet without need to click onto the 'X' at the window top right hand-side button.

i use this code "System.exit(0);" to close the program but it seem don't work and a list on error display in the Dos by the Java compiler. :confused: I don't understand why my can't workout because when i have referred to many Java reference book & most of the book use "System.exit(0);" to close the applet. :study:

Pls advice :) .. 10q

aaa 02-26-2005 10:53 AM

System.exit is not allowed in applets for security reasons. See this:

snutz411 02-26-2005 11:48 AM

if your applet is on a JFrame, have the action listener for the button do something like


i'm efficient with java, but i haven't coded any applets, so if i'm wrong, my bad.

All times are GMT -5. The time now is 01:37 AM.