LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-25-2005, 08:02 PM   #1
ekl_n
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, 10:53 AM   #2
aaa
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:
http://java.ittoolbox.com/documents/document.asp?i=2568
 
Old 02-26-2005, 11:48 AM   #3
snutz411
Member
 
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

Code:
yourframe.dispose();
i'm efficient with java, but i haven't coded any applets, so if i'm wrong, my bad.
 
  


Reply


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 02:13 AM
need some help with a java applet gulo General 1 07-14-2005 02:52 PM
java applet is not working mixedmemes Linux - Software 2 09-24-2004 12:25 AM
Java applet error: "Applet Failed" nro Programming 1 08-28-2004 05:52 PM
Netscape and Java applet asianboi2k Linux - Software 2 10-17-2003 08:29 PM


All times are GMT -5. The time now is 05:15 AM.

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