Sign in to follow this  
DutchValiance

[java] Frame Creation after other frame closes.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this