I have one main JFrame for my program which creates another JFrame, like a JOptionPane. However, I chose not to use a JOptionPane because the new Jframe contains a form in which the user enters some data.
My question is: how do I close this second JFrame when the user clicks the "OK" button? Is it possible without using a JOptionPane?
The problem is that my first class instantiates the JFrame for the second class. The second class extends JPanel and therefore cannot see the dispose() method.
The solution I have so far is to have the second class nested in the first.
Willie Smits can speak 40 languages. This tiny ad can speak only one: