I'm trying to create a TextArea
,
@FXML
private TextArea ta;
and what I'm trying to get :
for (int i=1; i<=5; i++) {
ta.setText(" Field " + i + "\n");
}
but it only show the last line : Field 5
.
Can anyone help. Thanks in advance.
ta.setText("")
before the loop, then in the loop,ta.setText(ta.getText() + " Field "+i+"\n");
– CondyloidtextArea.appendText(" Field "+ i +"\n");
in the loop. – Phyllotaxis