質問

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