public static void main(String[] args) {
    Assert.setEnabled(true);

    Log.setApplicationName("WindowControlImpl");
    Log.setApplicationVersion("0.0");
    Log.setApplicationVersionDate(
        "$Id: WindowControlImpl.java,v 1.1 2001/07/27 21:01:12 ashuk%eng.sun.com Exp $");

    try {
      org.mozilla.webclient.BrowserControlFactory.setAppData("nonnative", args[0]);
      org.mozilla.webclient.BrowserControl control =
          org.mozilla.webclient.BrowserControlFactory.newBrowserControl();
      Assert.assert_it(control != null);

      WindowControl wc =
          (WindowControl)
              control.queryInterface(org.mozilla.webclient.BrowserControl.WINDOW_CONTROL_NAME);
      Assert.assert_it(wc != null);
    } catch (Exception e) {
      System.out.println("got exception: " + e.getMessage());
    }
  }
  private void createNativeBrowser() throws IllegalStateException {
    try {
      Rectangle r = new Rectangle(getBoundsRelativeToWindow());
      Assert.assert_it(null != webShell);

      WindowControl wc =
          (WindowControl) webShell.queryInterface(BrowserControl.WINDOW_CONTROL_NAME);
      // This createWindow call sets in motion the creation of the
      // nativeInitContext and the creation of the Mozilla embedded
      // webBrowser
      wc.createWindow(nativeWindow, r);
    } catch (IllegalStateException ise) {
      if (LOGGER.isLoggable(Level.SEVERE)) {
        LOGGER.log(Level.SEVERE, "Exception while creating native browser", ise);
      }
      throw ise;
    } catch (Exception e) {
      if (LOGGER.isLoggable(Level.SEVERE)) {
        LOGGER.log(Level.SEVERE, "Exception while creating native browser", e);
      }
      throw new IllegalStateException(null != e.getCause() ? e.getCause() : e);
    }
    return;
  }