E Armitage wrote:Do not have two top level components in the same program. Use one JFrame and add/remove different components (e.g JPanels) to it if you want to display different things.
Hi thanks for your help.
I have got the solution for this problem instead of using a new JFrame or JPanel I used JDialog.
When using JDialog the parent frame stops its execution until child dialog is set invisible.
Thanks for your responses.