title: MVC-Pattern enabling buttons on event in Java
body: <p>I'm getting started with the MVC-Pattern right now and have something I'm pondering about. Imagine following case:</p>
  
  <p>I've got a view (obviously). In this view the User can select a file and then click a "Load"-Button. As soon as this load-button is clicked, all other components in my gui should be enabled as they are set to "disabled" as long as no file has been loaded.</p>
  
  <p>What I've done till now:</p>
  
  <p>I have created a view according to the following scheme:</p>
  
  <pre><code>public class GUI implements Observer {
    private JButton loadButton, showButton;
    private JComboBox nameBox;
    private Controller controller = new Controller();
  
    // Initialising Component and so on...
    loadButton.addActionListener(... // calls the loadFile()-Method
  
    public void update(Observable arg0, Object arg1) {
      // What to do here?
  
    }
  }
  </code></pre>
  
  <p>And a controller like this:</p>
  
  <pre><code>public class Controller extends Observable {
    public void loadFile() {
      // Load selected File
      notifyObservers(); // &lt;--- What should they be notified about in order to enable their component?
    }
  }
  </code></pre>
  
  <p>So my problem is that I am not sure whether it is sensible to enable the components over the controller. Or is it better to check in the view, if the file has been loaded and then set the components to enabled?</p>