clOrdID1.setText((Integer.toString(root.getChildren().size())) + 1);
Te above code will get the size of the number of elements (e.g. 1
), and then convert it to a string, now it is "1"
, and then it will do "1" + 1
, which is string concatenation, so you will get "11"
.
What you want to do is move the +1 to be inside the toString() method, and make it addition instead of String-concatenation:
clOrdID1.setText((Integer.toString(1 + root.getChildren().size())));
Sorted!