JavaFX code editor with content highlighter for Ja

2019-04-07 21:55发布

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.

2条回答
手持菜刀,她持情操
2楼-- · 2019-04-07 22:28

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.

查看更多
女痞
3楼-- · 2019-04-07 22:29

RichTextFX let's you specify style classes for ranges of text. Take a look at the Java keywords demo and its source code.

查看更多
登录 后发表回答