Forum Stats

  • 3,769,832 Users
  • 2,253,027 Discussions
  • 7,875,218 Comments

Discussions

display string in TextArea()

843807
843807 Member Posts: 46,582
edited Sep 26, 2002 4:20AM in Java Desktop Applications
this is my Java code :
******
string str,text;
TextArea displaytext = new TextArea(16,80);

str = value.toString();

text += str + "\n";

displaytext(text);

***********

The problem is nothing shown in the displaytext when i run the program
Pls help

Comments

  • 843807
    843807 Member Posts: 46,582
    The key information - what happens in the method displaytext is missing. Take a look at http://java.sun.com/j2se/1.4/docs/api/javax/swing/JTextArea.html
    (you need to use the method setText)

    Something like:
    TextArea displaytext = new TextArea(16,80);
    displaytext.setText("bla bla");
This discussion has been closed.