Y
Y
Yaroslav2014-10-19 20:38:29
Java
Yaroslav, 2014-10-19 20:38:29

JavaFX + Swing = brakes (3-5 sec)?

I am developing an application. Screen capture (java.awt.Robot) and tray functions are vital. JavaFX does not have them and will not appear soon. But if you use both JavaFX and Swing at the same time, there are very unpleasant brakes at startup, while separately the libraries work instantly quickly.

Are there any good 3rd party free libraries for screen capture as well as tray management? Or can this problem with the brakes be fixed somehow?

At worst, you will have to do the entire application in Swing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Plotnikov, 2015-01-28
@alexplot

JavaFX is not multi-threaded, which is not the case with Swing. It is possible that when you start your application, you are doing some lengthy work that causes the JavaFX UI to be blocked from updating for a while.
Try to perform resource-intensive operations in a separate thread, and if this operation involves UI changes, then call the UI update operations via Platform.runLater()
For example, this question about the ProgressBar, which is not updated as it should:
stackoverflow.com/questions/27090426/ progressbar-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question