Passing info between JFrames...

Bulldog13

Golden Member
Jul 18, 2002
1,655
1
81
Hello,

I have created 2 JFrames. I want to pass information from 2 textboxes in one to 2 corresponding boxes in the other JFrame. I am not sure at all how to go about this? I am an experienced VB coder, but have to develop in java.

I understand I would have to use a get/set object?

What kind of code would I put in the sending JFrame and what kind in the receiving JFrame?

Any help is greatly appreciated.

-Mike
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
One way to do this is events. Create a custom event that can pass the information you need. Create an event listener in JFrame A, and register it to listen for the custom event fired from JFrame B. In JFrame B, simply fire the event when you want the information passed.

Sun's website has some good tutorials on this. Check the Event Handling lesson and the Writing event handlers section.