[java] Frame Creation after other frame closes.

Started by
1 comment, last by DutchValiance 15 years, 3 months ago
Hi, is it possible to get the status of a frame? say i am running a frame from an application... import java.awt.*; public class GameMain { public static void main (String [] args) { new GameFrame (); } // main method } // GameMain class is there something i can do that returns if the GameFrame is visible or has been closed? Which i then want to create a new Frame.
Advertisement
I'm not sure about AWT but IIRC in Swing I sometimes just created a new frame after the frame.setVisible(true) call, which returned when the frame was closed.

However, you should have the possibility to register window event listeners (e.g. WindoListener, WindowStateListener) to the frame which can handle those events like closing a frame. For example, the WindowListener.windowClosing()/WindowListener.windowClosed() and WindowListener.windowOpened() methods could be what you need.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
got it thanks

This topic is closed to new replies.

Advertisement