title: Closing a Frame from a Panel
body: <p>Let me first explain the situation,
  I have a class with a JPanel called panelclass.
  It's method getPanel() returns the JPanel.</p>
  
  <p>In a JFrame class called frameclass, I create a new object of panelclass, got its panel and added it to the frame pane.</p>
  
  <p>What I am trying to achieve is, when a button in paneclass is clicked, It should close this JFrame ie.frameclass.
  I donot know how a panelclass can communicate back to the frameclass to close.
  I tried this.dispose() and super.dispose() but was not successful even after extending JFrame</p>
  
  <p>Is there a simpler way?
  Please do help.</p>