I\'m developing a simple application to manage the operational part of a business using Swing, but I need that when the application exits, it performs this:
Are you using a JFrame? if so you can try this:
myframe.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(WindowEvent winEvt) { updateZonas(); db.close(); System.exit(0); } });