How to handle java web start (jnlp) downloading progress in a preloader?

前端 未结 2 706
鱼传尺愫
鱼传尺愫 2021-02-05 03:20

Issue

I have a preloader for my application that handles the Application-specific initialization. Now I\'m trying to extend this so that the preloader also shows the p

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 03:46

    Note: I haven't tested or executed the code; my answer is primarily based on looking at the code. I haven't worked on JavaFX but I can grasp the code since I've worked on Swing and JNLP before.

    The first thing I notice, is that in Phase 2, the default JavaFX preloader handling the downloading of the application JARs is not showing.

    This seems to be because of the PreloaderFX.start(stage) method. The stage passed as the method's argument remains empty because the method constructs a new Stage() and adds children to it. If you add the child elements to the method's argument, it should display your custom preloader/progressbar during phase 2.

    If the code still doesn't work as expected after this, I'd try debugging all the logic/code associated with the noLoadingProgress flag. Try commenting all that out (essentially taking noLoadingProgress out of the picture) and see if it fixes the issue.

    Also, even though you've got this right in your code, see this answer - according to which all ProgressNotifications are handled by the handleApplicationNotification method.

    Hope this helps!

提交回复
热议问题