In the following code there is a JTextArea with an initial string. When the user changes the text in the JTextArea and clicks on update on the menu bar, class2.update() is called which in turn calls a class1.getText() method which should return the text in the JTextArea. The problem I am having is that the inital string is always returned. For troubleshooting I added a line in the actionPerformed() method that calls the same class1.getText() method. However, this time the current contents of the text are returned.
How do I get the class2.update() method to print the current contents of the JTextArea?
Also, where are the initial contents of the JTextArea being stored so that they keep being returned in the update() method?
The following code is a model of an application I am writing. If someone can help me understand what is happening here I will be able to apply it to my application.
(edited by Cindy to format code)
[This message has been edited by Cindy Glass (edited June 18, 2001).]