posted 8 years ago
I have a JFrame with a couple of buttons on it. I use a 1/3 of a MVC pattern on it - with that I mean that I implement VC, not the model. I think this also is called the strategy pattern. When somebody clicks on a button, an anonymus inner class in the "view" gets called and forwards it to the "controller". But now I want pop up a new JDialog box which also has a controller. My question is this; should the new JDialog and the controller be wholly instantiated within the method in the controller for the JFrame? Or should the be reference variables on a class level in the controller? I can't seem to figure out what is the best solution and any help would be appreciated!