• Dear Guest, Please do NOT forget to join our JAVA JOBS (ONLY) FACEBOOK GROUP to be aware of latest JAVA openings, and you may also post any JAVA related queries/jobs.

how to preserve text formatting in java

i am creating a blog which have different topics and user can give their comments.
i am stuck at one point, when user posts its comment, it will not in the format
what the user write in the textarea.

for e.g

this is a nice topic

coming as:

Hi this is a nice topic Thanks

i want that comment post would be in same format as its posted
i think i have to write a java class for formatting but i dont have an idea of it

can any one suggest me waht to do.

Thanks in advance