Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-25-2005, 09:02 PM   #1
LQ Newbie
Registered: Feb 2005
Posts: 2

Rep: Reputation: 0
Post 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. 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.

Pls advice .. 10q
Old 02-26-2005, 11:53 AM   #2
LQ Guru
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
System.exit is not allowed in applets for security reasons. See this:
Old 02-26-2005, 12:48 PM   #3
Registered: Mar 2004
Distribution: Slackware 10.0
Posts: 55

Rep: Reputation: 15
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 03:13 AM
need some help with a java applet gulo General 1 07-14-2005 03:52 PM
java applet is not working mixedmemes Linux - Software 2 09-24-2004 01:25 AM
Java applet error: "Applet Failed" nro Programming 1 08-28-2004 06:52 PM
Netscape and Java applet asianboi2k Linux - Software 2 10-17-2003 09:29 PM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration