PDA

Click to See Complete Forum and Search --> : int to string??


Lechugas
Oct 15th, 2000, 08:28 PM
Hi to All! Suppose that I want to show in a label the value of an int
variable, how can I do that? When I try to assign the int as the argument of
the setText method of the Label the compiler complains and argues that they
are not convertible types. What can I do?

Thanks

Blitz
Oct 16th, 2000, 11:30 AM
Use this function if I still remember correctly:

toString(int)

noone
Oct 16th, 2000, 08:45 PM
myLabel.setText("" + myInt);

When the compiler see's you are trying to join an int to a String it will autimatically call the right method to convert.