title: closing of Jframe when clickig a jbutton
body: <p>i have design two JFrames in netbeans(new-> Jframe ) and add one botton on each jframe , when i click a button from frame1 it opens Jframe2 its okay but i want is that the  JFrame1 should be closed  or not appear on the window..and alternatively when i click button from jframe2 it opens jframe1 but jframe2 should be closed..the one thing i achieved is jframes are opening on buttons click but jframes are not closing as per my requirements.. 
  so i need expertise from you guys to fix this problem. </p>