Getting data from another jframe
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.
Re: Getting data from another jframe
Yes, showing some code would be helpful. Show the "calling block" in the 1st JFrame and as much of the code of the 2nd JFrame to show how the value you want to share is captured and stored or communicated to the 1st JFrame.
I'm also wondering about this statement, "This is because 2nd Jframe starts working only when calling block in 1st JFrame executes completely," which may be based on some behavior you've observed, so it would be helpful if you'd describe that better.
Using a JFrame for the second dialog may not be optimal. A JDialog may be better, but show the code and we'll talk more about that.