java - JTextArea setText is not working -
I have a problem setting the text in JTextArea, I tried the settex (which I liked) and added I do not know where the problem is, I've got the customer-server app. I want to send the message that the server sends in JTextField, but I am unable to here my code:
The client-side code that messages properly Receiving:
try {socket socket = new socket ("localhost", port); BufferedReader input = new BufferedReader (new InputStreamReader (System.in)); DataOutputStream Output = New DataOutputStream (socket.getOutputStream ()); BufferedReader Server Input = New BufferedReader (New InputStreamReader (socket.getInputStream ())); Output.writeBytes (output string + "\ n"); Input sting = server input Rolledline (); // Private String InputString MyModel.SetextexAria (InputString); // It is not working System.out.println (inputstring); // This is working socket.close (); } Hold ...
setTextArea method:
Public Zero SetTextArea (string string) {MyPanel mypanel = new MyPanel (); Mypanel.textArea.setText (string); // Debugger shows that the string has a message from the server}
Since Setter Method was not working since I have set Textera publicly, Actually it also works not doing. I do not know where the problem is, and Debugger is not helping me either.
Edit your answer
JTextTable code:
textArea = new JTextArea (1, 30) ; TextArea.setEditable (wrong); Panel.add (Textaria, C);
Try to gain access through the recipient such as
public JTextArea getTextArea () {back jTextAreaField; }
and then
getTextArea (). Attachments ("ur text");
Comments
Post a Comment