While I’ll certainly not put much time into learning JavaFX, I did poke around at it a little, and it is a nice API. Â It’s better designed than Swing, and easier to write clean code in. Â In any case, I decided to see how RSyntaxTextArea worked in a JavaFX app, now that JavaFX 8 “fully” supports embedding Swing components into JavaFX apps.
It was pretty easy to do, and at first glance, worked great:
However, I hit a big snag: Â When I resized the window, (what seemed like) every other repaint resulted in everything *but* the Swing content being unpainted!
I say every other repaint, because slowly resizing the window you would see constant flicker, between blackness instead of JavaFX rendering, and the JavaFX goodness you were supposed to see.
I took out the RSyntaxTextArea, this does not happen.  So this does not seem to occur in JavaFX apps with no Swing embedded in them.
I added in a JButton instead of the RSyntaxTextArea. Â The flicker did not happen. Â So it seems to not be all Swing content that does this.
I replaced the JButton with a JTextArea. Â The flicker came back. Â Okay, so it’s only *certain* Swing components.
Note that there is flicker with stand-alone JTextAreas/RSyntaxTextAreas; JScrollPanes don’t have to be in the equation to see this issue.
So what’s the deal? Â Somehow certain Swing content causes the JavaFX rendering pipeline to bug out.