0

I want that the population with data to be triggered after the GUI part has been loaded. My Controller implements the Initializable interface and has only the initialize function and I was wondering if this is possible. I do not want to use Spring for Java FX, I have searched on google for this but i did not find any solution until now and any help would be greatly appreciated.

Adriana Frunza
  • 53
  • 1
  • 1
  • 5
  • 1
    Which particular part of this are you stuck with? Create a different class that handles the data-centric functionality and instantiate it and call appropriate methods from your `initialize()` method. If it takes a long time to perform those methods, you might need to put the calls in a [background thread](https://stackoverflow.com/questions/30249493/using-threads-to-make-database-requests). – James_D Aug 23 '17 at 12:06
  • Thanks James_D for your reply. I already know this :) But I want to have a special function that does something like a post init. I do not want to call from initialize method if it's possible. I want to avoid this. – Adriana Frunza Aug 23 '17 at 12:15
  • 1
    Why would you want to avoid that? That's precisely what `initialize()` is for, unless I am misunderstanding what you are asking. – James_D Aug 23 '17 at 12:18
  • Because my commands for taking information about the hardware of a computer will take some time and I want first the GUI to be displayed, if I put everything in initialize , the GUI will not be displayed untill all the information is taken. – Adriana Frunza Aug 23 '17 at 12:53
  • 1
    Why don't you launch a background thread from the `initialize()` method? I provided a link that explains how to do that in my very first comment. – James_D Aug 23 '17 at 12:54

0 Answers0