public static void main(String[] args) {
    Browser browser = new Browser();
    BrowserView browserView = new BrowserView(browser);

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.add(browserView, BorderLayout.CENTER);
    frame.setSize(800, 600);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);

    browser.setDownloadHandler(
        new DownloadHandler() {
          public boolean allowDownload(DownloadItem download) {
            download.addDownloadListener(
                new DownloadListener() {
                  public void onDownloadUpdated(DownloadEvent event) {
                    DownloadItem download = event.getDownloadItem();
                    if (download.isCompleted()) {
                      System.out.println("Download is completed!");
                    }
                  }
                });
            System.out.println(
                "Destination file: " + download.getDestinationFile().getAbsolutePath());
            return true;
          }
        });

    browser.loadURL("ftp://ftp.teamdev.com/updates/jxbrowser-4.0-beta.zip");
  }