Is it possible to call a class(Jframe) by pressing ok on Joptionpane?

Asked

Viewed 49 times

-2

I would like to open another window by pressing ok on Joptionpane is it possible ? if Yes ! give me a Light ?

1 answer

1

Yes, just use the method showConfirmDialog(), and validate if its return is equal to the OK button of JOPTIONPANE. If so, you instantiate your Jframe like any other class with JFrame seuFrame = new JFrame();

See the Joptionpane class documentation to check how to validate the button return.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.