×

Genuine Coder's video: JavaFX Background Tasks How to make your GUI smoother faster and snappier

@JavaFX Background Tasks | How to make your GUI smoother, faster and snappier
In this tutorial, we will explore JavaFX Concurrency and learn how to make use of JavaFX Background Tasks to make the JavaFX applications run faster, smoother, and snappier. JavaFX main thread (or the GUI thread) is responsible for drawing and refreshing the contents shown on the screen 60 times a second. That means the delay between each frame is only 16.67 milliseconds. If we do complex calculations or time-consuming blocking works on this main thread, then it will not be able to reach the 60fps target. In fact, it can even reduce to 1 frame per 3s or 5s which could make the application "not responding". If the application is non-responsive for a couple of seconds, the OS will start showing the "not responding" title on the title. JavaFX provides support for offloading time-consuming tasks into a background thread using the Task approach. Tasks provide a very easy and direct approach for executing code asynchronously while providing constant updates to the GUI thread. In this chapter, we will explore the javafx.concurrent.Task and see how to make use of it to seamlessly run complex background operations in a separate thread while updating the GUI consistently. Github Project: https://github.com/afsalashyana/JavaFX-Tutorial-Codes/tree/master/JavaFX%20Task Genuine Coder Blog: https://www.genuinecoder.com/ Introduction: (0:00) Understand the problem with the GUI thread: (2:33) Create a new background task: (04:29) Update label from background task: (09:52) Add progress bar to track progress: (12:57) How to cancel a running task: (17:14)

269

29
Genuine Coder
Subscribers
21.9K
Total Post
194
Total Views
666.1K
Avg. Views
11.5K
View Profile
This video was published on 2022-03-20 23:21:10 GMT by @Genuine-Coder on Youtube. Genuine Coder has total 21.9K subscribers on Youtube and has a total of 194 video.This video has received 269 Likes which are higher than the average likes that Genuine Coder gets . @Genuine-Coder receives an average views of 11.5K per video on Youtube.This video has received 29 comments which are higher than the average comments that Genuine Coder gets . Overall the views for this video was lower than the average for the profile.Genuine Coder #JavaFX #Multithreading #Java Introduction: has been used frequently in this Post.

Other post by @Genuine Coder