Вопрос

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.

Это было полезно?

Решение

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.

Другие советы

Its pretty simple. Try this :

out.setText(out.getText()+value_2);

That's it.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top