• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame with multiple DialogBoxes

 
Besjamain Greenaway
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
think of how JOptionPanes work
 
Besjamain Greenaway
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually have no idea, but I'll look into it. Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!