loop when there is no user-input
i've got a question:
i program graphic applications e.g. where a user can press a button and then a joptionpane pops up and says "you have pressed a button".
but there has to be an idle-loop in the source code anywhere, where the compiler waits for a user-input (e.g. press a button).
i know that listeners "listen" if a button is pressed. but the compiler has to check anywhere IF this button is pressed....so can you please tell where i can find this loop in my source code?
would be glad if you can help!!