Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways to speed up TextArea in JavaFX 2 when loading a lot of text?

I'm using JavaFX 2 for UI. I'm having to put a lot of text inside of a TextArea; loading anywhere from 500KB to 1MB of text into the TextArea.

When doing this my UI is running slower with the BorderPane layout when resizing the panes. Is there a specific method to speed this up? Another UI component that I should be using?

like image 446
Jamel Toms Avatar asked May 01 '13 20:05

Jamel Toms


1 Answers

Seems, there is no better component for JFX text rendering now. You can rely on TextArea, or try textNode in stack pane as option. But nothing better.

There is an issue about preformance of TextArea : javafx-jira.kenai.com/browse/RT-16853

What I can suggest : you can implement your own component, which will have restricted functionality, but tweaked for performance : just understand, which part of text you must show, and create a Text node, which will render only very restricted part of text. And a piece of technical fantasy and straight hands.

Also, if you wish, you can fix the issue in existing TextArea, and push the fix into OpenJFX, and possibly, push the fix into existing JFX (8.0 version).

Also, you should try 8.0 version, because it actually contains significant performance fixes and improvements.

like image 132
Alexander Kirov Avatar answered Oct 01 '22 14:10

Alexander Kirov