Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to wait for a JFrame to close.

807600Sep 22 2007 — edited Sep 22 2007
I've created a JFrame and set it to visible, but i need to hold my main() until it finishes. I'm using while(EEMain.isVisible()); as a place holder right now, but it just uses up cpu cycles needlessly, i tried

while(EEMain.isVisible()) {
try {
wait(100);
} catch etc.....

to make it a little less cpu intensive, but main() is static and wait() isn't. How can i wait for the JFrame to finish without burning so many cycles?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2007
Added on Sep 22 2007
8 comments
6,479 views