This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have created an object of a class A by using textboxes of a frame Af and save it to an ArrayList called AList. I then created an object of a class B by using a textboxes of another frame Bf and save it to another ArrayList called BList. There are 2 separate ArrayList because there are 2 different frames Af and Bf. I also have created another frame Df that contains a TextArea. How would I pass the objects that I have created to show in frame Df's TextArea using an ActionListener that is implemented on each Af and Bf? I tried to do: ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent event) { Df.TextArea.append(//A's or B's methods); } }; But I got a compile error. Can someone help me?
HI Daniel, It would probably be helpful to explain what your compiler error is. One way to do it would be to create a frame Df then pass that into Af and Bf creations so that they can keep track of the Df frame. Then in each actionPerformed method you can call a method such as localDf.showText( String s ); and have the actionPerformed method fill in s for the Df frame. Regards, Manfred.
Daniel Sie
Greenhorn
Joined: Aug 13, 2001
Posts: 7
posted
0
Thanks I'll try that.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: transfering an object variable from one class to another