I\'m working on a game. In this part, a new window opens up to show the game instructions. The only problem is that the JTextArea only shows one line of the .txt file, when ther
You are reading only one line from a file. Try using this instead to load entire file.
List lines;
try {
lines = Files.readAllLines();
} catch (IOException ex) {
ex.printStackTrace();
}
StringBuilder text = new StringBuilder();
for (String line : lines) {
text.append(line);
}
read = new JTextArea(text.toString());