Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
JTextArea loses format/line breaks after storing in database?
Post Flair (click to view more posts with a particular flair)
Post Body

Hi, I have a JTextArea where the user inputs text. The user inputs:

good morning

have a nice day

then I store it as a string in my mysql database, but when I retrieve the data from the database and display it on say a JLabel the output is

good morning have a nice day

where the line breaks have disappeared and the formatting of the originally input text is not the same. How do I go about storing the data in the database that when I output it it will have the same format/line breaks as the original input text?

Author
Account Strength
90%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
2,724
Link Karma
1,904
Comment Karma
820
Profile updated: 1 day ago
Posts updated: 2 weeks ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago