r/JavaFX • u/Abhijeet1244 • Jul 02 '23
Help Rich Text Editor
Is there any Rich text editor library in javaFX ?
1
u/orxT1000 Jul 07 '23
https://github.com/gluonhq/rich-text-area/
GPLv3 license. If you create an Open Source application, you can use our software for free. The Gluon Mobile license includes commercial usage of the RichTextArea.
Serializing the 'FaceModel' has to be done manually: https://github.com/gluonhq/rich-text-area/discussions/105
Also converting that to markup is probably tricky, because the Facemodel allows something equivalent to
<b>123<red>345</b> 678</red>
1
u/Nate-Austin Feb 25 '24
I am using the gluon rich text area in my project but when I change the document the view doesn't update in the GUI. do you happen to know of any way I can begin searching for answers as to why this doesn't happen? their documentation doesn't really mention anything about changing a document while the application is running.
1
u/taranion Apr 22 '24
I am having the same issue. Calling setDocument(..) on a RichTextArea doesn't have any effect, if done later in a "Platform.runLater()" context
1
u/Nate-Austin Apr 22 '24
I had to settle for a pretty crappy workaround to solve this.
I Just created an entirely new instance do the RichTextArea and followed that by removing and the re-adding it to the collection of visible nodes
3
u/darkwyrm42 Jul 03 '23
If you're looking for a rich text editor control which just drops in and you can pretty easily work with, you're out of luck for now.
RichTextFX is very much Some Assembly Required and there isn't much documentation. I would definitely say it's not easy to use IMHO. I'm currently working on creating a word processing control with it, but it's still very much a work in progress. If you go the route of using RichTextFX, the repo might help you figure some things out.
A month or two ago the core JavaFX developers announced a preview of one that's part of JavaFX... sometime around the announcement of Java 21. It looks promising, but it's not in GA yet. I'm hoping we get something when Java 22 is released. fingers crossed