I am creating a Java program with Java Swing to make my own link.
I had make a JTextArea for user to text and the system will automatically create a link.
For example:
The user input follows in the JTextArea box
Good Day
I am so happy
Then the system will automatically create a link
https://MyWebsites.com/content=Good Day%0AI am so happy/
Which means that the system will automatically adding %0A at every line return.
I would like to know how can I adding %0A at the every line.
I am thinking of two ways to solve.
1: Edit contents of JTextArea
The %0A will directly added in the JTextArea.
2. Adding when get String
The content will NOT be affected, it will only be added when getting data from JTextArea.
(Advance)
If possible, the system should first check every line, if there are %0A on that line before adding it.