Formatter fmt=new Formatter();
Calendar cal=Calendar.getInstance();
fmt.format("%tc",cal);
System.out.print(fmt);
//而不是System.out.print(fmt);
我想打印的fmt
上JTextArea
。但價值,因爲我們知道JTextArea
只接受字符串value.So我怎麼能轉換成Formatter fmt
相當於String value
。我如何執行以下轉換?
而不是'\ r \ n'我推薦'System.getProperty(「line.separator」)'。 – corsiKa
的確,我編輯了我的答案以代替它 –