Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Designing a splash screen (java)

I want to design a splash screen that can show the current loading process with a progress bar, much like netbeans startup screen, as it shows

loading... modules, done!.... loading modules and so on 

and after the loading finished the main application comes up.

I have read many articles that are related to only creating a splash screen but none of them addresses about How to display progress of different background tasks on a splash screen.

How can I achieve this?

Can I use javafx 2 for splash screen while the rest of the application is written using java

Solved!

I finally managed it to work. My mistake was I was updating the GUI content in the Task Thread so My Task Thread was Blocked and could not execute the next instructions after the GUI update instructions.Now I shifted those Updating GUI instruction after Task Completion, and its working..... Thanks Jewelsea for the right path.

like image 712
Deepak Avatar asked Apr 03 '12 16:04

Deepak


1 Answers

I created a splash page sample for a standalone JavaFX 2.0 application previously.

I updated the sample to demonstrate monitoring of the load progress via a progress bar and progress text on the splash page.

To adapt the code to monitor the initialization progress of your application, rather than tying the ProgressBar to a WebEngine's loadWorker.workDone property, create a JavaFX Task which performs expensive initialization work, and monitor the progress of the Task via the Task's progressProperty and messageProperty.

Here is a link to a splash based sample based upon the Task approach outlined in the prior paragraph.

For a WebStart or browser embedded JavaFX application, use a preloader as suggested by assylias.

like image 83
jewelsea Avatar answered Sep 30 '22 00:09

jewelsea