I presume that code compiles.
Copy all the .java files into their own directory and navigate thither with the terminal/command line. Use ls(*nix) or dir(Windows®) to view the contents of that directory. Compile everything and see what you get. There will be a .class file called something like FormPanel$1.class. You can see that the anonymous class has created its own .class file.
Now, you have an object of the ActionListener attached to the button. What happens when you click on the button is that an Event occurs, creating an event object. That object is passed to the glass pane of the
frame, which can do nothing with it, so it passes it to whichever Component is underneath that location, where the button has a listener which can intercept it. When the listener object intercepts the event, it fires the actionPerformed method.
You know that in Java8 you can replace the listener object with a functional feature (=a λ), something like
myButton.addActionListener((evt) -> {myAction();});
… where myAction is some method or other accessible from where you happen to be. Delete all the .class files and compile, and you will see the $1.class file does not reappear.
As for the form listener: don't know. If somebody has supplied you with that interface, there should be a description of it; if not, ask them. I am not convinced the
Java Tutorials are much help on this point. There is an interface called
EventListener and I presume that is what you are extending. I presume that means you can add that Listener and the form event will cause it to run its form event method.