code: private void configure(final Container container)
      {
          try
          {
              // Use invokeAndWait so that we can be sure that initialisation is complete
              // before continuing.
              SwingUtilities.invokeAndWait(new Runnable()
              {
                  public void run()
                  {
                      try
                      {
                          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                      }
                      catch (Exception ex)
                      {
                          // This should never happen as we are installing a known look-and-feel.
                          System.err.println("Failed to load System look-and-feel.");
                      }
                      prepareGUI(container);
                  }
              });
          }
          catch (InterruptedException ex)
          {
              // Restore interrupt flag.
              Thread.currentThread().interrupt();
          }
          catch (InvocationTargetException ex)
          {
              ex.getCause().printStackTrace();
              JOptionPane.showMessageDialog(container, ex.getCause(), "Error Occurred", JOptionPane.ERROR_MESSAGE);
          }
      }
docs: Configure the program to display its GUI in the specified container.
  @param container The container to place the GUI components in.