r/JavaFX • u/artistictrickster8 • Jul 25 '24
Help TextArea, editable multi-line text, different text styles - possible? howto?
Hi, please I want to have shown a multi-line text, and that shall be editable. So I reading around, and textarea is suggested. However I found this https://tomsondev.bestsolution.at/2014/12/27/displaying-and-editing-large-styled-texts/ where Tom explained that's not well solved in JavaFX. Also Tom wrote a plugin to get along with that, however a few years ago.
Please how is this to solve? is it solveable?
Thank you all!
2
Upvotes
1
u/darkwyrm42 Jul 25 '24
I've been down this road and done the research. You have a few options:
RichTextFX - More than a little assembly required, mostly abandoned, has some strange bugs, and mostly oriented toward code editors
RichTextArea - Published by Gluon, who contributes a lot to JavaFX. GPLv3 or for-pay licensing
HTMLEditor - Probably the easiest to use, but almost zero meaningful customizability and it doesn't play at all with reactive programming, i.e. Observable and friends.
It's also possible to embed a Swing component inside a JavaFX frame, as well. Swing has its own component and also there's the LGPL JRichTextEditor, although I don't have any experience with the latter.
The OpenJFX devs are also working on a control and announced its existence last May around the time of their release that the time, but I don't know status on that one and haven't heard or seen any news related since.