Не работает перенос строки - Java

Узнай цену своей работы

Формулировка задачи:

 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         

            try{
                File file = new File("list.txt");
                FileWriter out = new FileWriter(file, true);
                try{    
                                    if(!file.exists())
                    file.createNewFile();
 
                                     for(int x=0;x<2;x++){
                                         
                                              for(int y=0;y<7;y++){
                                          out.write(jTable2.getValueAt(x,y).toString()+ " ");  
                                        }
                                              out.write("\n");
                }
                    } finally{
                        out.close();
                    }
                }catch(IOException e1){
                    throw new RuntimeException(e1);
            }
Pаполняю таблицу по на;атию кнопки, затем хочу вывести ее содержимое в файл. Почему то не работает перенос на другую строку в файле, просто никак его не отображает в файле даже. Пробовал и append.

Решение задачи: «Не работает перенос строки»

textual
Листинг программы
File file = new File("d:/list.txt");
        try (FileWriter out = new FileWriter(file, false)) {
            for (int x = 0; x < 2; x++) {
                for (int y = 0; y < 7; y++) {
                    out.write(x + " " + y + " ");
                }
                out.write(System.lineSeparator());
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

Оцени полезность:

6   голосов , оценка 4.333 из 5