I am working on a program in which i have 2 jframes.
From 1st JFrame i am calling 2nd JFrame.
Now when 2nd Jframe is made visible( i have a simple button on 2nd frame) on clicking a button on it i store some value in my variable in 2nd frame and disable 2nd JFrame.
Problem in this is, the value i get from 2nd Jframe variable is not correct or rather default value. This is because 2nd Jframe starts working only when calling block in 1st JFrame executes completely.
Please tell me how can i get data from 2nd JFrame only after setting value.
Also tell me if you didn't get the question i will try to put snippet.
Thanks & Regards
"Those who never made a mistake never made a discovery"
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.
Joined: Feb 09, 2013
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.