how to call a method into setText() or append()?

hello there

i've made a JTextArea and i want to check the return of that method

address.isReachable(3000);

and print it on the TextArea

how to do that?

thanks

[197 byte] By [microsmarta] at [2007-11-27 10:54:30]
# 1

boolean b = address.isReachable(3000)

testArea.setText(String.valueOf(b));

// textArea update or revalidate or whatever here

?

CeciNEstPasUnProgrammeura at 2007-7-29 11:50:38 > top of Java-index,Java Essentials,New To Java...
# 2

thanks but it gives me an error cannot find simple

final Timer timer = new Timer(2000, new ActionListener() {

public void actionPerformed(ActionEvent arg0) {

boolean b = address.isReachable(3000);

textArea.setText(String.valueOf(b));

}

});

in this line boolean b = address.isReachable(3000);

microsmarta at 2007-7-29 11:50:38 > top of Java-index,Java Essentials,New To Java...
# 3

So what's the error?

Edit:

or by "cannot find simple" you mean "cannot find symbol"?

In which case, I reiterate what is the error exactly?

Message was edited by:

dwg

dwga at 2007-7-29 11:50:38 > top of Java-index,Java Essentials,New To Java...
# 4

Oh come on, if you can't keep your own variables and their scope straight, there's not much we can do to help you.

CeciNEstPasUnProgrammeura at 2007-7-29 11:50:38 > top of Java-index,Java Essentials,New To Java...
# 5

my guess is that that method is not reachable. ;-)

petes1234a at 2007-7-29 11:50:38 > top of Java-index,Java Essentials,New To Java...