Search code examples
javajavafxrichtextfx

Implementing RichTextFX GenericStyledArea


I am trying to implement the RichTextFX GenericStyledArea into a program of mine, however, I cannot find an example which clearly shows how the program works in order to implement the feature and as such I have no idea how to implement it. If you could help show how a GenericStyledArea is setup and implemented that would be great or alternately provide another library with the same functionality.


Solution

  • Have you tried out any of the demos at https://github.com/FXMisc/RichTextFX#demos? They include links to the source code used to create them. The source code for several demos is available in the source under RichTextFX-master/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/ if you downloaded the source.

    I'm new to RichTextFX as well (so weight my advice accordingly), but you might want to consider using one of the subclasses of GenericStyledArea like StyleClassedTextArea instead, depending on the functionality you need. If those are unsuitable for you, then at least you can treat their source code as examples of how to use GenericStyledArea.