I just got the idea of using my own designed jDialog boxes as Joptionpane in my jFrame form. The problem is that I was unable to retrieve information from the dialog box.
Can you provide an
SSCCE so we can see what you mean.
Another problem is that I tried to close the jFrame form through the click event of a JButton but i found it difficult to do.
You would normally only have one JFrame in an application, any other windows you want to open would be JDialogs.
To close either type of window call setVisible(false) and then possibly dispose() to free up resources.
Again though without code it's hard for us to know what/where your problem is.