I want to write some text to JtextArea of class1 from class2 . How can i do that? Thanx in advance for any suggestion

Recommended Answers

You can pass it to the other class either through a constructor or method call in the second class or you can make it public in the original class.

Jump to Post

All 3 Replies

You can pass it to the other class either through a constructor or method call in the second class or you can make it public in the original class.

Create a public method in class1 that accepts the text as a parameter and updates the test area as required. From class2, just call that method.

thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.