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