[java] Frame Creation after other frame closes.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement