How to Capture New Line in JTextArea?
843806May 26 2008 — edited May 26 2008I apologize if this is easy, but I've been searching here and the web for a few hours with no results.
I have a JTextArea on a form. I want to save the text to a database, including any newline characters - /n or /r/n - that were entered.
If I just do a .getText for the component, I can do a System.println and see the carriage return. However, when I store and then retrieve from the database, I get the lines concatenated.
How to I search for the newline character and then - for lack of a better idea - replace it with a \n or something similar?
TIA!