V
V
Valentin Hetman2018-08-03 10:19:40
Java
Valentin Hetman, 2018-08-03 10:19:40

JavaFX TEXTAREA missing line breaks after saving?

I save the writer.write(textArea.getText()) file, open it in my notepad and sublime and everything is fine, I open the spaces through the Windows notepad and the tabulation remains, but the new line transitions disappear, which I have already shoveled a cloud of information and nothing helps. Thanks for answers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alexandrov, 2018-08-03
@spotyk

This problem is not javafx and not even java itself, but specifically windows and its notepad.
In the world, it is customary to carry out a line break with codes simply through \n (LF or U + 000A code) and this is correct for Linux / Macs / Androids / iOS and everything else.
In the Microsoft world and their windows, the \n\r code (LF and CR code) is required, and this is how everything works in the system. Some developers or PLs are able to automatically determine what is meant here, as an example of the same sublime. Windows and its notepad do not know how to do this.
The newline character is usually referred to as EOL (End Of Line).
So if the Windows notepad is so important to you, then replace the EOL with the correct ones and everything will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question