title: Why Println is affecting my while loop?
body: <p>I'm stuck on this since almost 5 hours and I cannot find any answer.</p>
  
  <p>Here is the piece of code you need.</p>
  
  <p>Client.java</p>
  
  <pre><code>public class Client {
  
      private GUI     _GUI = new GUI();
  
      public Client() {
  
      }
  
      public void Run() throws Exception {
  
          _GUI.Run();
          System.out.println("before");
          while (_GUI.isOver() == false)
          {
              System.out.println("azerty");
          }
          System.out.println("after");
          _GUI.Stop();
      }
  }
  </code></pre>
  
  <p>GUI.java</p>
  
  <pre><code>public class GUI {
  
      final static String STARTPANEL      = "startpanel";
      final static String LOBBYPANEL      = "lobbypanel";
      final static String GAMEPANEL       = "gamepanel";
      final static String ENDPANEL        = "endpanel";
  
      private JFrame      _MainWindow     = new JFrame();
      private CardLayout  _MainLayout     = new CardLayout();
      private JPanel      _MainPanel      = new JPanel(_MainLayout);
  
      public GUI() {
          InitWindow();
          InitPanelLayout();
  
      }
  
      public void Run() {
  
      }
  
      public void Stop() {
          _MainWindow.dispose();
      }
  
      private void InitWindow() {
          _MainWindow.setTitle("Mille Borne");
          _MainWindow.setSize(1020, 920);
          _MainWindow.setResizable(false);
          _MainWindow.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
          _MainWindow.setLocationRelativeTo(null);
          _MainWindow.setVisible(true);
      }
  
      private void InitPanelLayout() {
          _MainWindow.add(_MainPanel);
  
          //_MainPanel.add(STARTPANEL);
          //_MainPanel.add(LOBBYPANEL);
          //_MainPanel.add(GAMEPANEL);
          //_MainPanel.add(ENDPANEL);
      }
  
      public boolean isOver() {
          if (_MainWindow.isVisible() == true) {
              return (false);
          }
          return (true);
      }
  
  }
  </code></pre>
  
  <p>If I remove this line in the Client.java</p>
  
  <pre><code>System.out.println("azerty");
  </code></pre>
  
  <p>The program is not exiting the loop, the "after" is not displayed. </p>
  
  <p>Can someone explain me what is going on ?</p>
  
  <p>Thanks for your help !</p>