I want to write a text editor in JavaFX which acts similar to Eclipse/Netbeans IDE to highlight the Java code. Can anyone suggest as to how it can be achieved or anyone has done this previously.
Thanks.
I want to write a text editor in JavaFX which acts similar to Eclipse/Netbeans IDE to highlight the Java code. Can anyone suggest as to how it can be achieved or anyone has done this previously.
Thanks.
There's no pure JavaFX libraries for the code highlighting / editing as far as I know, so if you want to implement it in JavaFX you're going to be translating from a similar Swing (or other) project, or you're on your own.
However, you can use such a Javascript library and wrap it in a WebView if you want to achieve this - Jewelsea (who often swings by here) has done just this and explained it rather nicely here.
RichTextFX let's you specify style classes for ranges of text. Take a look at the Java keywords demo and its source code.