You could consider using a JTextArea
instead of a JTextField
. A text area is a multi-line text field and has an append(String text)
method.
Any suggestions for multiple out.setText();
-
28-06-2022 - |
Question
In my Java project with WindowBuilder Pro. I use methods to return a values then out.setText(value_1);
but when I try to out.setText(value_2);
a value_1
has been removed.
My solution is to String show = out.setText(value_1).concat(value_2)
and then out.setText(show);
. Does anyone have another suggestions/solutions of this problem?
Thanks.
La solution
Autres conseils
Its pretty simple. Try this :
out.setText(out.getText()+value_2);
That's it.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow