Jump to content
  • Advertisement
Sign in to follow this  
DutchValiance

[java] Frame Creation after other frame closes.

This topic is 3470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!