title: How to set divider location for JSplitPane on start-up
body: <p>I have JPanel which contains JSplitPane. The JPanel is injected during a runtime into a JFrame using the method invokeAndWait. Then the invokeLater is called to update divider location in SplitPane.<br>
  The problem is, when the divider update is invoked, JPanel width is still 0.<br>
  When I add sleep or a breakpoint anywhere in the code (except the invokeLater), the code works fine.  </p>
  
  <pre><code>    final JPanel viewPanel = new JPanel();
      viewPanel.setLayout(new BorderLayout());
  
      final JPanel header = getPresenterHeader(getPageTitle(), getPageInstructions());
      viewPanel.add(header, BorderLayout.NORTH);
      viewPanel.add(getSplitPane(), BorderLayout.CENTER);
  
      toolbar = createActionsToolBar();
      toolbar.addAction(new ExitPresenterAction(this));
      viewPanel.add(toolbar, BorderLayout.SOUTH);    
      addContent(viewPanel);
  
      SwingUtilities.invokeLater(new Runnable()
      {
          @Override
          public void run()
          {
              splitPane.setDividerLocation(0.5);
          }
      }); 
  </code></pre>