How to comunicate between two frames?

Hello:

I have a problem on comunicating between two frames. For example :

There is a textField A and a button A in Frame A. When I click the button A, it will pop up a Frame B. As Frame A, Frame B also have a textField B and a button B. On Frame B, I type some words in textField B. Then I click the button B to close Frame B. I want the textFiled A on Frame A can get the words typed in textField B.

Could you please help me to reslove this problem?

Thank you very much.

[509 byte] By [angelatg] at [2007-9-26 4:06:10]
# 1
frame1.textfield1.setText(frame2.textfield2.getText());Humm! I think that this works.
GLJdotcom at 2007-6-29 13:06:14 > top of Java-index,Archived Forums,Java Programming...
# 2

this is one way to do it of many ways.

in frame A add this method

public void SetTextField(String string)

{

textfieldA.setText(string);

}

in frame B instantiate frame A

FrameA frame = new FrameA();

in your button listener put

string value = textfieldB.getValue();

frame.SetTextfield(value);

this should work but i haven't tested it

rsinyard at 2007-6-29 13:06:14 > top of Java-index,Archived Forums,Java Programming...