andyw27
asked on
Using setText function - mixing text and variables
I'm using the setText function.
What the synatx for mixing variables and text ?
Is it something to what used in c printf("Variable1 is %d", variable1);
Many thanks.
What the synatx for mixing variables and text ?
Is it something to what used in c printf("Variable1 is %d", variable1);
Many thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'ved tried the above code but get:
int cannot be dereferenced error ?
Any idea's?
ASKER
Its okay I fixed it now, it did'nt need the toString method.
in java you dont need to string convertion to write int variables to screen.
myLabel.setText("Var1 value: " + myVar1.toString() + ", Var2 value: " + myVar2.toString());