Reputation: 4150
I'm making an application by MVC architecture. My question is: how can I share an istance of a model between many classes in controller?
It is difficult 'cause I'm using a listener,I would call by this listener a controller passing it a model:
class ButtonListener1 implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println(e.getActionCommand());
if(e.getActionCommand().equals("Inizia")){
//call a controller passing it a model
}
}
}
Upvotes: 0
Views: 52