title: How can I return a value from a JDialog box to the parent JFrame?
body: <p>I have created a modal JDialog box with a custom drawing on it and a JButton.  When I click the JButton, the JDialog box should close and a value should be returned.</p>
  
  <p>I have created a function in the parent JFrame called setModalPiece, which receives a value and sets it to a local JFrame variable.</p>
  
  <p>The problem is that this function is not visible from the JDialog box (even though the JDialog box has a reference to the parent JFrame).</p>
  
  <p>Two questions:
  1) Is there a better way to return a value from a JDialog box to its parent JFrame?</p>
  
  <p>2) Why can't the reference to the JFrame passed to the JDialog be used to access my JFrame function setModalPiece?</p>