Hello everyone.
I am working on JFrame and i was wondering if i could somehow close the frame and then reopen it -whith a different contxet- using a loop.

What do you mean from a different context?

To close:

System.exit(0);


To open:

Just create an instance

What do you mean from a different context?

To close:

System.exit(0);


To open:

Just create an instance

I mean each time the frame will have a new context. But i dont need the old frames, so i have to close them somehow and keep the most recent only.

what context?

And don't close your frame with System.exit(0) as that will terminate the entire JVM and thus stop the application dead in its tracks.

I totally don't understand what you're asking for.

I totally don't understand what you're asking for.

Its ok, i got it. I am working on connect4 and i was trying to use a frame for the graphics. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.