The name of the java file has to be identical to the class name.

Bad idea. Use packages.

Also you should start a GUI from the EDT. You're asking for trouble with that code.