Results 1 to 7 of 7
- 04-12-2010, 08:21 AM #1
Passing data from one JFrame to another JFrame. - need help.
My main JFrame will open a second JFrame that has serveral input fields to gather user input and store that information in a String. Once a confirm button has been pressed I need to send that newly created String variable to the main JFrame where I can then use it for other things.
How do you send the newly created string to the main JFrame once the button is clicked?
I've tried creating a method inside the second JFrame to call for that particular String but I am not quite sure how I make the main JFrame wait until the confirm button on the second JFrame has been hit before I call that method.
- 04-12-2010, 09:03 AM #2
- 04-12-2010, 09:33 AM #3
I've read about that while doing some research but unfortunately JDialog is beyond the scope of material covered in my classes. I also think I may lose marks if I start to venture into material that I dont fully understand or have a full grasp of.
can I design and code a JDialog just like a JFrame?
- 04-12-2010, 09:47 AM #4
- 04-12-2010, 09:49 AM #5
I've been doing some pokin around with the JDialog and I might actually go this route because it's providing me with exactly what I need.
JosAH can you explain to me what .dispose() does and if I should be using it when I want to hide the window?
- 04-12-2010, 10:07 AM #6
- 04-12-2010, 11:33 AM #7
Instead of creating another posting I'm just gonna go a head and ask my next question here since its along the same lines as my topic.
Once I return from the JDialog back to the JFrame, how do I refresh element/components within the JFrame?
I'm trying to refresh a JList once I've returned back from the JDialog... in this case the JDialog is actually adding elements to teh JList's model.
I've tried .repaint(), .validate(), .updateUI() and thats with the entire JFrame and the components alone aswell. but no success.
- By sinha in forum AWT / SwingReplies: 7Last Post: 12-16-2009, 05:56 PM
- By tarami in forum New To JavaReplies: 3Last Post: 08-06-2009, 05:44 PM
- By Robert_85 in forum Advanced JavaReplies: 4Last Post: 04-22-2009, 11:02 PM
- By Joe2003 in forum AWT / SwingReplies: 6Last Post: 01-08-2009, 01:14 AM
- By abhiN in forum New To JavaReplies: 2Last Post: 03-28-2008, 06:39 AM