I have a problem with my Java app, I set the necessary for reduce to icon in traybar and set:
app.getMainFrame().setDefaultCloseOperation(HIDE_ON_CLOSE);
So when I close my app in taskbar will be close, but the app continue to run and it’s visible the icon to taskbar.
The problem is: How can I restore the app from the taskbar?
I tried:
app.show(app.getMainView().getFrame());
app.getMainView().getFrame().setVisible(true);
app.getMainView().getFrame()setVisible(true);
but neither of them worked.
You need to restore it to the default state:
Edit: tested this with a
JFrameand it works fine. See:This basically just shows the
JFrameas soon as it is hidden.