Forums Register Login

Getting data from another jframe

+Pie Number of slices to send: Send
Hi,
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.
Thank you.
1
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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.
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1539 times.
Similar Threads
Java lang NullPointerException error
Java lang NullPointerException error
Opening a jPanel Form in jFrame form using NetBeans IDE
Reg: Jframe
How to set Value from 1 frame to another ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:12:07.