yay this first time that I develop something larger
My problem: main method display a frame with buttons where you choose what function/action you want to perform. Once you press a button I want the main window become invisible and windows with option for function to become visible.
So what I did is
Came to same conclusion when I went to bed(funny enought I always find solution to problem went I go to sleep). But thats fine as long there would be solution :lol:
Now this peace of code doesn't do exactly what I want to do
myApp.setVisible(false); // pass control to selected function
doSomething();
myApp.setVisible(true); // retrive control
}
it hidde myApp for time which take to display second application window and then it will display it again. I'm missing sort of control mechanizm which check if second window still in use, if yes keep it hidden. I tried to use while loop and check boolean in second application, but that kicked my CPU activity to 100% and I have to force to shut-down.
So how I do I get around this?
Secondly, I use JFrame setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) to close my windows, but this kill both frames.
So how do I specify I want to close only second JFrame?
NEW UPDATE
Problem with killing both JFrames sorted, replaced JFrame.EXIT_ON_CLOSE with JFrame.DISPOSE_ON_CLOSE.
Now I add it WindowEvents so if windowDeactivated it will setVisible to false and windowActivated to setVisible to true. However I can't triger windowActivated when I close the second window.
What shall I do?
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.