Why Javafx UI hangs or become unresponsive on using Plarform.runLater() ?
Michael Berry
mjrb5 at kent.ac.uk
Sun Oct 19 16:29:59 UTC 2014
Perhaps a silly question - but do you really need millions of lines in the
text area? When you're displaying this much text then from my understanding
things are bound to hang (simply because of the processing overload) and
there's not really a great deal you can do about it. You can see if there's
any extraneous delay by profiling and seeing if there's any GC bottlenecks
(or suchlike) then tweak those options, but I doubt you'll ever get to no
delay at all with dumping this much data in a textarea.
I'm not aware of the details of your application, but can you just create
the text in memory somewhere else, and create an FX component that acts
like a text area, but dynamically reads the text in from memory as the user
scrolls? This way you'll just be altering a relatively small amount of text
much more continuously, and shouldn't notice much of a delay. (I took a
similar approach with Swing a long while ago for a project, but sadly can't
find the source for that now.)
Michael
On 19 October 2014 16:58, Navdeep Singh Sidhu <
navdeepsingh.sidhu95 at gmail.com> wrote:
> Hello,
>
> I know this mailing list is for OpenJFX developers and to discuss
> development related issues. I don't know it is OK to post my query here or
> not. But i assume if you people are developing the OpenJFX, so there will
> be no other person better than you or have more knowledge related OpenJFX
> than you guys :) .
>
> My query is that i'm trying to develop an IDE for parallel computing
> integrated with framework and output from all nodes has to be represented
> in TextArea. I am using multiple threads to collect Output from all the
> nodes and appending that output on TextArea using Platform.runLater(), i am
> even using flags to reduce the flood on UI thread, that output will be
> appended if the output is larger than 50000 lines then after each 50000
> lines to TextArea else it will be appended as it is. Even submitting one
> task in the system, UI hangs when trying to print millions of line output
> on TextArea and i couldn't test it with multiple tasks. Can you suggest me
> something to prevent UI thread from becoming unresponsive. I know i'm not
> good programmer as you guys but i'm trying to learn JFX and new to this.
>
> BTW thank you guys for such a beautiful interface in JAVA. :)
>
> Regards
> Navdeep Singh Sidhu
>
More information about the openjfx-dev
mailing list