public Finder(final DjVuBean bean)
  {
    searchField=null;
    if(classTextField != TextField.class)
    {
      try
      {
        searchField = (Component)classTextField.newInstance();
      }
      catch(final Throwable exp) {}
    }
    if(searchField == null)
    {
      searchField = new TextField();
    }

    searchBack           = createButton(SEARCH_BACK_BUTTON);
    searchFwd            = createButton(SEARCH_FORWARD_BUTTON);
    searchDocumentBack   = createButton(SEARCH_DOCUMENT_BACK_BUTTON);
    searchDocumentFwd    = createButton(SEARCH_DOCUMENT_FWD_BUTTON);

    setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
    add(searchDocumentBack);
    add(searchBack);
    add(searchField);
    add(searchFwd);
    add(searchDocumentFwd);
    djvuBean = bean;
    setBackground(Toolbar.LIGHT_GRAY);
    setForeground(Toolbar.BLACK);

    for(Enumeration e = buttonList.elements(); e.hasMoreElements();)
    {
      final ToggleButton button = (ToggleButton)e.nextElement();
      button.setBackground(Toolbar.LIGHT_GRAY);
      button.setForeground(Toolbar.BLACK);
      button.addActionListener(this);
    }

    final int documentSize = bean.getDocumentSize();

    if(TextField.class.isAssignableFrom(searchField.getClass()))
    {
      ((TextField)searchField).addActionListener(this);
    }
    else
    {
      final Object[] args = {this};
      DjVuObject.invoke(addActionListenerMethod,searchField, args);
    }
    
    //searchField.addActionListener(this);
    searchDocumentFwd.setVisible(documentSize > 1);
    searchDocumentBack.setVisible(documentSize > 1);
    lastButton=searchFwd;
    String text=bean.getSearchText();
    if((text == null)||(text.trim().length() == 0))
    {
      bean.properties.put("addOn.finder", "false");
    }
    else
    {
      if(TextField.class.isAssignableFrom(searchField.getClass()))
      {
        ((TextField)searchField).setText(text);
      }
      else
      {
        final Object[] args = {text};
        DjVuObject.invoke(setTextMethod,searchField, args);
      }      
      bean.properties.put("addOn.finder", "true");
    }
    bean.addPropertyChangeListener(this);
    updatePage(new Integer(bean.getPage()));
    updateTargetWidth(
      -1,
      bean.getTargetWidth());
  }