Example now I have a main frame contains jtable display all the customer information, and there was a create button to open up a new JFrame that allow user to create new cus
just use firstFrame.setVisible(false) on the first frame. This will make it hidden..
if you want a more general approach you could have a reference to the current displayed frame somewhere and change it when a new frame requests to be shown
JFrame currentFrame;
void showRequest(JFrame frame)
{
currentFrame.setVisible(false);
currentFrame = frame;
currentFrame.setVisible(true);
}