exiting an application

How do I exit my program ? I do not want them to close the browser window, but rather hit a button for example, because there is cleanup. By the way, system.exit(0) throws an exception. Thanks
[206 byte] By [MartinLeaf] at [2007-11-26 10:23:40]
# 1
See if this helps http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=63936Mono
mono at 2007-7-7 2:25:04 > top of Java-index,Development Tools,Java Tools...