Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Similar "Handler" class in Java

Recently learning Android, there is a Handler class in android which is very useful. We can "post" runnable object to the end of another thread, something like queue, it is very dynamic in that case. Anyone know any similar class in Java SE that is able to do that?

like image 899
Sam YC Avatar asked Sep 14 '12 15:09

Sam YC


1 Answers

JavaSwing has SwingUtilities.invokeLater() that takes a Runnable as paramter. That's one way to post something on the UI Thead

like image 72
Blackbelt Avatar answered Oct 20 '22 18:10

Blackbelt