jumptrooper, on 22 August 2010 - 06:32 PM, said:
I went through and coded this tutorial and like I said before, you did a great job. I did, however, find something interesting and I'm wondering if you might be able to explain it for me.
Whenever I exited the program using the "close" menu item, the window would disappear but the process would continue to run. I kept having to manually terminate the program from the command line. I modified the relevant portion of the event handler to say:
And this fixed everything (I can actually get rid of the this.dispose(); line altogether and it works fine too). I did this on an Ubuntu linux computer - could that have anything to do with it? Is "this.dispose();" supposed to terminate the program or just visually remove the window and all its resources?
Did anyone else run into this?
Whenever I exited the program using the "close" menu item, the window would disappear but the process would continue to run. I kept having to manually terminate the program from the command line. I modified the relevant portion of the event handler to say:
// if the source of the event was our "close" option
if(e.getSource() == this.close){
this.dispose(); // dispose all resources and close the application
System.exit(0);
}
And this fixed everything (I can actually get rid of the this.dispose(); line altogether and it works fine too). I did this on an Ubuntu linux computer - could that have anything to do with it? Is "this.dispose();" supposed to terminate the program or just visually remove the window and all its resources?
Did anyone else run into this?
The close menu item worked perfectly for me and terminated the process as it should, not sure why it didn't work for you.







MultiQuote








|