Java – text editor with syntax highlighting and line numbers?
This is a bit of a challenge for a team project, let alone a single person implementation, but I tried to use jeditorpane to combine a simple and elegant text editor with syntax highlighting I happened to find that this has stopped using. It's hard for me to understand all lexer files and Lex content I even found in some blogs that this project was later adopted by other teams, but even if it was discontinued again I don't need it to be too fancy, like there are code folds and things (although I'd like to know how to do this), but I need at least a basic syntax to highlight the existence and quite a lot of line numbers. The far left is like Notepad Remember, I just need it to highlight the Java source code, at least for now
What I'm looking for is a tutorial, a well-documented example and sample code, a prefabricated package, and even NetBeans tools. I don't need to write source code from scratch. I just need an implementation that can be used Thank you in advance!
P. S. this will not be commercialized or too big. Don't ask why I want to reinvent the wheel. When there are so many programming editors, I'm learning. It's a good exercise for me!
Solution
Rsyntaxtextarea is licensed by BSD and supports your requirements, code folding, etc It's very easy to use