Example usage for javax.swing AbstractButton addMouseListener

List of usage examples for javax.swing AbstractButton addMouseListener

Introduction

In this page you can find the example usage for javax.swing AbstractButton addMouseListener.

Prototype

public synchronized void addMouseListener(MouseListener l) 

Source Link

Document

Adds the specified mouse listener to receive mouse events from this component.

Usage

From source file:com.haulmont.cuba.desktop.sys.DesktopToolTipManager.java

/**
 * Register tooltip for {@link javax.swing.AbstractButton}.
 * Tooltip is displayed when the user hovers over a button
 * ToolTip text is taken from {@link javax.swing.JComponent#getToolTipText()}.
 *
 * @param btn Button to register/*from w ww  .ja v  a 2 s  .  c o  m*/
 */
public void registerTooltip(final AbstractButton btn) {
    btn.removeMouseListener(componentMouseListener);
    btn.addMouseListener(componentMouseListener);
}

From source file:org.nuclos.client.ui.collect.Chart.java

public void addToolbarButtonMouseListener(MouseListener l) {
    for (AbstractButton b : toolbarButtons.values())
        b.addMouseListener(l);
}