Hello, I have two different classes called Login (in the package View) and RegButtonListener (in the package Controller). I want to use the MVC
pattern.
Login creates a GUI for login. I used NetBeans GUI Builder to create it.
In the class RegButtonListener there is the code for the click of the buttons, then various listeners of the GUI.
Now I want to close the login frame at the click of a button so I want to use the
dispose() method.
If I had all the code (GUI code and code of the listener) in the same file, close the frame would be easy enough to do because
this.dispose().
But in my case I have two different classes.
I also have a second problem.
In Login class (in the packege View) I have included the line
regButton.addActionListener(Controller.RegButtonListener). However, Netbeans tells me an error
"package regButton does not exist. <identifier> expected". Why does he consider regButton a package? How can I fix these two problems?
How do I do then?
thanks
Below is the code of the two classes.
Login class.
RegButtonListener class
Thanks!