Each time the user performs an action, such as pressing a key on the keyboard, moving the mouse, or perhaps banging their head against a touch screen, Java generates an event .
Article
This is Java simply receiving such events from underlying OS and putting them on Event Dispatch Thread. Given focus in windowed contexts, some objects automatically handle some events relevant to them.
If you declare a class-type variable without assigning it an object, it doesn’t point to anything.
Link
Java doesn’t allow static allocation of objects on the stack. Everything is dynamically allocated on the heap.