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
Sorry for the late answer but have you considered the Singleton design pattern? It will return the same instance of a class whenever you want the class. So if the user wants a frame to enter the details, there will only be one frame open (same instance)
It goes something like this:
private static MySingleFrame instance = null; //global var
private MySingleFrame() { } //private constructor
private static MySingleFrame getInstance()
{
if(instance == null)
{
instance = new MySingleFrame();
}
//returns the same instance everytime MySingleFrame.getInstance() is called
return instance;
}