First of all, welcome to the Ranch and the fascinating world of Java.
About your JFrame class, it pretty much looks like you have posted the code of a frame that you designed in NetBeans (or similar IDE). The whole code in initComponents() method declaration is auto-generated. Since you are providing the user with a Swing interface, it's only recommended to use the frame itself for coding rather than having a separate class.
With an IDE such as NetBeans, it's quite easy to do this. All you need to do is just use the GUI design mode and use the components context menus.
For example, consider you have a Frame named myFrame
, in which you have few textfields and a Submit and a Cancel button. Your aim would to be close/kill the window on clicking "Cancel". For this, in design mode, you just right-click the "Cancel" button and go to
Events-> action -> actionPerformed
When you click on actionPerformed, you will be taken to source code and a method will be readily created of the form
Now all you need to do here is, write this in your method.
Also, this could help you a lot in what you wish to do. This should give you a basic idea... Keep digging in.
Also, if possible, please post a screenshot of your frame here so it would help others to assist you better.