This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to tell when main() is done in swing

 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I am running into issues where I do not want to do certain things until my Frames main() method is complete. I.E. since the frame is still in an initializing state I want other function calls to behave a little differently. I know I know that is bad design but I didn't design the code and a re-design would be a nightmare at this point.

So I have some class that derives from JFrame and in it has a main to run.



So when I am doing other things once my frame is running can I call something on the MyFrame class to see if the main has completed?

If I cannot I supposed I could set a simple variable in MyFrame like isInitializing to true at the beginning of the main and set it to false at the end of my main. I just didn't know if there was something already built in, no need to reinvent the wheel.

If anyone else has any ideas on how to solve a problem like this i welcome you thoughts.

Thanks,
Billy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic