Search code examples
javamultithreadingswingconcurrencyevent-dispatching

how java threads makes UI more responsive?


I have read JAVA SWING UI become more efficient with the help of threads.But i dont know how the java threads makes the UI more perfect in Swing.

Please Enlighten me on this...


Solution

  • Using threads you can do work asynchronously without blocking the UI. Lets say you have two buttons Search google and Search bing ( yes on your swing UI can not think of better analagy right now :) )

    If you were not using threads your application window will block i.e. you will not be able to click other button or do any thing else until first function has completed but with thread nothing is blocking and you can continue on working and using you UI even click both at the same time .