title: Dialog that returns an Object
body: <p>Is it possible to create a JDialog in swing that would return an object when OK button is clicked?</p>
  
  <p>For example the Dialog box has text fields that have components that make up an adress ( street name, country etc.)</p>
  
  <p>When the OK button is clicked an Address object is returned.</p>
  
  <p>Why I thought this to be possible was because of <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html#input" rel="nofollow">this</a>. But what I want is something like I mentioned above.</p>
  
  <p>Any pointers on how to get this done would be very helpful.</p>