public static void main(String[] args){ JFrame test = new JFrame(); test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JTextArea textArea = new JTextArea(); StringBuilder sb = new StringBuilder(); try{ BufferedReader buff = new BufferedReader(new FileReader("D:\\fichier.txt")); try { String line; while ((line = buff.readLine()) != null) { sb.append(line).append("\n"); } } finally { buff.close(); } } catch (IOException e) { e.printStackTrace(); } textArea.setText(sb.toString()); test.add(new JScrollPane(textArea)); test.setSize(400, 400); test.setLocationRelativeTo(null); test.setVisible(true); }