Cheshan Shaleekshana Cheshan Shaleekshana - 3 months ago 11
Java Question

How put each array value into text-field in Java?

i tried to put array values into separate textfields. but IDE indicate code is always gone wrong.there are 6 text fields and 6 values in the array.so i need that 6 array values put into textfields. check my code and help me correct it.
(This array is Integer one)

import java.util.Arrays
.
...

numO1.setText(Arrays.toString(Isortarray[0]));
numO2.setText(Arrays.toString(Isortarray[1]));
numO3.setText(Arrays.toString(Isortarray[2]));
numO4.setText(Arrays.toString(Isortarray[3]));
numO5.setText(Arrays.toString(Isortarray[4]));
numO6.setText(Arrays.toString(Isortarray[5]));

Answer

Hope this will help you :)

numO1.setText(String.valueOf(Isortarray[0]));