Sam Smith

Greenhorn
+ Follow
since Jun 18, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sam Smith

Try this link to Matthew Robinson's book "Swing." It has a chapter on printing (Chapter 22) that includes printing tables. That chapter is available in .html, Microsoft Word .doc, and .pdf formats.
http://manning.spindoczine.com/sbe/
24 years ago
Thanks for the help, Mike. I am new to object-oriented programming. It was a lot easier to fix my code than I thought it would be. I just removed the line in Class3 that creates a Class1 object and then referenced class2.class1. Works beautifully!
24 years ago
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).]
24 years ago