示例#1
0
  protected void initToolbar() {
    // toolbar for home, history buttons, et al.
    toolBar = new BrowserToolBar(this);
    toolBar.setFloatable(false);

    getContentPane().add(toolBar, BorderLayout.NORTH);
  }
示例#2
0
  public void setBrowserLocation(String locale, boolean cacheLocation) {
    // push old location if one exists AND its specified behavior
    if (cacheLocation && location != null) {
      locationStack.push(location);
      toolBar.getBackButton().setEnabled(true);
    }

    location = locale;
    try {
      browserPane.setPage(location);
    } catch (IOException ioex) {
      String message = "Error loading from location:\n" + ioex.getMessage();
      JOptionPane.showMessageDialog(this, message, "Browser Error", JOptionPane.ERROR_MESSAGE);
      return;
    }
  }