I have a simple HTML text Editor which I'm trying to convert into an IDE. I'm finished with the basics (Like adding a file browser and running the project). The next obstacle I'm facing is adding themes.
I googled and found this question but it requires adding the text before changing its color.
What behaviour I want is similar to JetBrains Webstorm (Or IntelliJ IDE):


Like @MadProgrammer mentioned, you can use RSyntaxTextArea.
From its README:
Example Usage:-