How it works...

In this recipe, we called the methods of our GUI class in their own threads and learned that we have to start the threads. Otherwise, the thread gets created but just sits there waiting for us to run its target method.

We noticed that each thread gets assigned a unique name and ID.

We simulated long-running tasks by inserting a sleep statement into our code, which showed us that threads can indeed solve our problem.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.2.225