maincan be in any class, but it's often simplest to understand if it's in a separate class.
mainshould do very little work -- typically this means just create a window (
JFrame) and display it.
actionPerformed) may be mixed in with the GUI construction code. This makes the code hard to understand. Define methods that these listeners call and put those methods in one place, so the GUI construction can be separated from the GUI execution.