Q:

Show FrameView after HIDE_ON_CLOSE

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.

A:

You need to restore it to the default state:
app.getMainFrame().setVisible(true);
app.getMainFrame().setState(Frame.NORMAL);

Edit: tested this with a JFrame and it works fine. See:
JFrame f = new JFrame("Test");
f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
while (true) {
    f.setVisible(true);
    f.setState(JFrame.NORMAL);
    try {
        Thread.sleep(100);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

This basically just shows the JFrame as soon as it is hidden.

