Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javafx - textflow + text = very slow

Tags:

java

javafx

I'm running a textflow in javafx with a lot of text fields inside of it. All told it's about 500 lines and ~20.000 text items.

The textflow itself is in a scrollpane so only partially visible. Scrolling is "ok" but any layout() action takes ages. Is there a way to limit textflow layout to the visible part? Or to speed it up in another way?

like image 206
nablex Avatar asked Oct 15 '25 15:10

nablex


1 Answers

The problem is that on layout() the system has to layout even invisible items. You need to use a VirtualFlow control like ListView to make the system only hold the nodes visible on screen!

There are various controls from the community out there to support rendering big amounts of text. See https://github.com/TomasMikula/RichTextFX/wiki/JavaFX-Controls-for-Code-Editing

like image 108
tomsontom Avatar answered Oct 18 '25 04:10

tomsontom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!