Maneesh Godbole wrote:I have reason to believe Mr. Rob Prime will be around today.
I guess you're right
Ryan is showing you the right way to minimize to tray. The minimization occurs all by itself but unless you hide the frame as well it will still be visible in the task bar. The reverse is first showing the frame again, then removing the minimized state as you already know how to.
Jhedzkie, are you sure your application is really terminating? Does the tray icon disappear as well? Is the java.exe or javaw.exe still visible in the Windows Task Manager?
I've tried your
test code for the JFrame only (so not the tray icon), and if I click [X] it minimizes and restores immediately after. Are you sure the frame has no other window listeners attached to it? If another window listener causes the application to be closed then that one is executed first.