Formatter fmt=new Formatter();
Calendar cal=Calendar.getInstance();
fmt.format("%tc",cal);
System.out.print(fmt);
//
System.out.print(fmt);
대신
JTextArea
에
fmt
의 값을 인쇄하고 싶습니다.하지만
JTextArea
는 문자열 값만 받아들입니다. 어떻게
Formatter fmt
을 동등한
String value
로 변환 할 수 있습니까?
대신'\ r \ n'을 사용하는 것이 좋습니다.'System.getProperty ("line.separator")'를 사용하는 것이 좋습니다. – corsiKa
사실, 대신 내 대답을 편집하여 사용했습니다. –