Java long calculations without freezes GUI (in single thread)
<p>At the interview, me was asked question: "How to perform many calculations in single thread without freezes GUI component like Progress Bar or that would be able to check another user input? (Can execute only one thread)"</p>

<p>I Asked that can write event loop like Node.js. 
But me say that Java already have some mechanism for it. That java can use hardware parallelization of operation. What the classes or special words can used for this task?</p>