-1
안녕 JTextArea
에서 getText()
메서드를 사용하려고 시도하고 .txt
파일에 쓰기. 텍스트 영역이 여러 행의 텍스트를 가지고 있는데 유지하려는 당신이 상상할 수 있듯이textarea에 getText() 메서드를 사용하고 textarea에 나타나는대로 txt 파일에 쓰는 방법?
try {
String = "OrderDetails.txt";
PrintWriter output = new PrintWriter(fileName);
output.println("Customer Details");
// this part is not important
output.println(txtAreaOutput.getText()); //Spits out multiple lines into a single line :(
output.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(FamousFavoriteSubs.class.getName()).log(Level.SEVERE, null, ex);
}
내가 .txt 파일에 텍스트를 저장할 때 : 여기 내 코드입니다. 이것을 할 수있는 방법이 있습니까?
: http://stackoverflow.com/questions/5880169/loading-a-text-file-into-a-textarea/5887380 # 5887380 – camickr