Ejemplo n.º 1
0
  /** This method installs listeners for the JToolBar. */
  protected void installListeners() {
    dockingListener = createDockingListener();
    toolBar.addMouseListener(dockingListener);
    toolBar.addMouseMotionListener(dockingListener);

    propertyListener = createPropertyListener();
    toolBar.addPropertyChangeListener(propertyListener);

    toolBarContListener = createToolBarContListener();
    toolBar.addContainerListener(toolBarContListener);

    windowListener = createFrameListener();
    floatFrame.addWindowListener(windowListener);

    toolBarFocusListener = createToolBarFocusListener();
    if (toolBarFocusListener != null) {
      int count = toolBar.getComponentCount();
      for (int i = 0; i < count; i++)
        toolBar.getComponent(i).addFocusListener(toolBarFocusListener);
    }
  }