2011-01-13 63 views
0

如何重新排列這些標籤以獲得不同的結果? 這是代碼:標籤重排

lbl1.setText(" File 1: " + File1.getName()); 

lbl2.setText(" File 2: " + File2.getName()); 

lbl3.setText(" Union: File 3 "); 

輸出現在的問題是:

文件1:first.txt

文件2:second.txt

聯盟:文件3

我想得到的僅僅是一條線:

聯盟:文件3(first.txt + second.txt)

謝謝

回答

1

希望我理解這個問題不夠好。如果你的意思是filenamesin你寫的格式結合:

lbl3.setText(" Union: File 3 (" + File1.getName() + "+" + File2.getName() + ")"); 
+0

這正是我需要的..謝謝你 – herbie 2011-01-13 09:19:51

1

尼爾是正確的....

lbl3.setText(" Union: File 3 (" + File1.getName() + "+" + File2.getName() + ")"); 

會爲你工作!