Is it possible to call a class (JFrame) by pressing okay on JOptionPane? [closed]

-2

I would like to open another window by pressing okay in JOptionPane it is possible ? if so ! give me a Light?

    
asked by anonymous 01.11.2018 / 03:03

1 answer

1

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

See the documentation for the JOptionPane class to see how to validate the return of the button.

01.11.2018 / 03:37