Originally posted by Nick Riviera:
You should be able to if you have a reference to the frame in question. For example, if you want to close a frame myFrame, you could do it like this:
<PRE>
myFrame.hide();
myframe.destroy();
</PRE>
You should be able to do this anywhere that myFrame is a valid reference.
Nick
So if I do have a Reference of the JFrame frame1 and if I have a method like this in the class which extends frame1
public void actionPerformed(ActionEvent e){
//Showing another frame2
frame2.pack();
frame2.setVisible(true);
frame1.hide();
frmae1.destroy();
}
Do u think this method is correct ?