Thursday, December 10, 2009

[Java] Please help: How can I append text in JTextArea from another class

 

I need help urgently.
i am a student and i am working on a project i need to submit very soon.
i have two classes A and B i need to append text in a text area in a from B. Below i have some part of my code.
I have tried something like this but it is not showing anything in the textArea. please somebody come to my rescue
Class A

Class A extends javax.swing.JFrame{
private JtextArea myTextArea;
A( ){
myTextArea = new JtextArea;
}
public void setArea(String mess){
myTextArea.Append(mess);
}
}

Class B
Class B{
A newA;
B( ){
newA = new A;
}
//i have this line which is supposed to append text in //myTextArea in class A
newA.setArea("message");
}

__._,_.___
Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
.

__,_._,___

No comments:

Post a Comment