aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Getting data from another jframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting data from another jframe" Watch "Getting data from another jframe" New topic
Author

Getting data from another jframe

prashant casfdasfsatg
Greenhorn

Joined: Feb 09, 2013
Posts: 4
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.


Thanks & Regards
Prashant C.
"Those who never made a mistake never made a discovery"
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
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.
prashant casfdasfsatg
Greenhorn

Joined: Feb 09, 2013
Posts: 4
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting data from another jframe