Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Trying to exit the Applet, but... please take a look

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello experts
please take a look about this part:
public void actionPerformed(ActionEvent e){}
I am trying to exit the Applet after type "quit" but not allow me to do that, there must be some wrong...
could you help me out?
thanks.
martha
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Martha,
I don't think you can control when your applet quits. The browser and therefore the user is in control of that.
Usually if you want to have something appear and then disappear after something happens you use JDialogs or JFrames. Then you can hide them or show them accordingly.
Regards,
Manfred.
 
Martha Yeh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Manfred,
yeah, i know. i tried System.exit(); and stop(); and destory();... man.. its just not work out that way i want.
ok, i guess i need to add the button "exit" or "quit" would be
easier than this??!!
thanks very much and good weekend
martha
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi martha,
Hey martha. You cannot use System.exit() in Applets. That is only possible in frames. In order to use System.Exit() in Applets you have to use policytools. It gives applet permission to work like frames. But while in browser you cannot use System.exit(). You can use System.exit() only when you view applet in appletviewer. I think you can use policytool in this. I hope this solves your problem
abhinav
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic