What happens under the control of Java events?

I have a very simple but complicated question. How is Java event driver programming implemented?

I mean, the JVM first receives a message from the OS, and then it must call some method, implemented perhaps with the right GUI component (like JFrame, I think). But is this fun for the programmer?

I do not know how to explain that I am better than some example: You have a window and a button. User clicks this button. Now the JVM receives from the OS that there were some mouse clicks and their coordinates. Now the JVM needs to call a method that processes the rest inside your code. Thus, there must be a moment when the JVM (originally written by SW) calls the appropriate part of the bytecode of your (my) Java application. What does he call a suitable action listener, but now I believe that this is your code.

So, in my example, is there any table of methods called directly by the JVM in Java Bytecode? Becouse I believe that if the JVM was looking for the correct method names, it could take a long time.

In Java, it's hard for me to understand this transition between the JVm and the activation code. I came from ASM and not from C languages, and I would be interested to know how this works inside Java. Becouse I know how this works on real HW. I hope you understand me. Thank.

+3
source share
1 answer

You should read some articles about the internal functions of the JVM: http://www.artima.com/insidejvm/ed2/index.html

+1
source

All Articles