Enabling/Disabling and updating text in swing components using two different threads other EDT

64 views Asked by At

I am newbie to the swing applications and need some help concurrency in swing.

I would like to know about that there is any bugs will be introduced to the swing application when the two operations such as enabling/disabling of the swing components and updating its content happens in two different threads.

I am trying to do this to improve the performance of the application. For example if enabling/disabling operations on a single JPanel takes 5secs for completion and update text on labels/textfields on the same panel takes 5 secs for completion . If we go with single threaded approach it will take 10secs to complete the whole task.

At the same time if we use two threads; one for enabling/disabling the component and another for updating its content, we can complete the same task in 5secs.

Could anyone provide information on below: Is there any issue if we follow this approach ? or any one operation can be done EDT and other can be scheduled run on EDT?

Thanks in advance.

0

There are 0 answers