Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Handler to Exit Java Applet

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Handler to Exit Java Applet

    I have coding a handler for an exit button. The button works fine in Eclipse, which is my IDE, and it closes the applet when clicked. However, when I click on the button to close the applet in the web browser, the applet will not close.

    I tried different codes, with System.exit(0), and System.exit(1), but none of them worked.

    I also tried with applet.getAppletContext().showDocument(appletClose URL), but for some reason I could not get the right syntax.

    If my URL is appletJava.com, would this be correct:

    this.getAppletContext().showDocument(appletJava.co m);


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Handler to Exit Java Applet

    Also posted at: Exit Java Applet
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. How to exit a login form
    By uijbaba in forum AWT / Java Swing
    Replies: 4
    Last Post: October 14th, 2013, 04:17 PM
  2. System.exit(0)
    By aknessy in forum What's Wrong With My Code?
    Replies: 7
    Last Post: October 14th, 2013, 04:10 PM
  3. Help on exit button/panel
    By pilyo143 in forum AWT / Java Swing
    Replies: 5
    Last Post: February 13th, 2013, 07:07 AM
  4. while loop wont exit
    By NewAtJava in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 29th, 2011, 11:42 AM
  5. Exit Status from Perl program called by java using runtime
    By twk in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 2nd, 2011, 02:19 PM