title: How do you return a value from a java swing window closes from a button?
body: <p>Basically, I have somewhere in my main code where this line of code is called</p>
  
  <pre><code>editwindow clubeditwindow = new editwindow(1,"Club Edit");
  </code></pre>
  
  <p>This line opens a new JFrame that can basically edit a bunch of information from the main class. I have 2 buttons called save and cancel. When save is clicked, I want to take the values from the textfields and then put it into a new object and return that to the main class, and close the window. When cancel is clicked, I want it to just not do anything, which is simple enough.</p>
  
  <p>Thanks in advance.</p>