title: Changing a JPanel to another JPanel doesn't repaint the change
body: <p>I have a main JPanel <code>target</code> in MainFraim and another <code>currentView</code> JPanel, which is added to the <code>target</code> panel. <code>target</code> panel contains buttons with listeners. These listeners are then supposed the change the content of the <code>curretView</code> panel, as demonstrated below:</p>
  
  <pre><code>private JPanel currentPanel;
  
  public void setView(String type) {
  
      if (type.equals("overall")) {
          this.currentPanel = getOverallView();
          frame.setTitle("BookingCalendar - Overall View");
          frame.validate();
      } else if (type.equals("guest")) {
          this.currentPanel = getGuestView();
          frame.setTitle("BookingCalendar - Room View");
          frame.validate();
      } else if (type.equals("room")) {
          currentPanel.removeAll();
          this.currentPanel = getRoomView();
          frame.setTitle("BookingCalendar - Guest View");
          frame.validate();
      }
  }
  </code></pre>
  
  <p>Every method I call returns new JPanel each time it is called:</p>
  
  <pre><code>JPanel currentPanel = new JPanel(new MigLayout("","20 [grow, fill] 10 [grow, fill] 20", "20 [] 10 [] 20"))
  </code></pre>
  
  <p>The problem is, whenever I call these methods, the panel won't change. It always stays the same (by default: <code>getOverallView()</code> )</p>
  
  <p>I've tried with invalidate, validate, repaint on both frame, as well as the panel, but no changes occur. Could someone please elaborate more as to what I need to do in order to completely change the content of the panel <code>currentView</code></p>