I'm looking for a rich textarea in javafx. I have tried the RichTextFX component by Tomas Mikula but it is too buggy for my needs.
I was thinking whether it would be possible to plug in a swing JTextPane using the SwingNode class.
So far it actually works as in, I can see the text in the JTextPane and the JScrollPane around it even works. A mouselistener on the JTextPane also seems to be triggered correctly for mouse events but other than that...nothing works.
There is no cursor indicating the current position, no way to "click" with the mouse to change the position, select text,...
Key events simply don't arrive (using a keylistener)
Is it possible to use a JTextPane in javafx and if so, what am I missing?
Currently I only know a workaround for this problem.node.setOnMouseReleased(event -> node.requestFocus());
(node is your SwingNode).
I used mouseReleased to mimic the same behavior as the standard FX nodes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With