I'm trying to access an instance (a JTextArea) in a public class fromanother file. How do I do that (this might be a little bit silly, but I haven'tdone this before?) Is there a good way of doing it?
If the other class was named OtherClassand the JTextArea was named textAreaOtherClass anotherClass = new OtherClass();JTextArea myTextArea =anotherClass.textArea;orJTextArea myTextArea = (new OtherClass()).textArea;
but it will only copy the JTextArea as it once wasinitialized. It won't get the content when I write something. Is there a way tokeep my new JTextArea updated from the other one?