javax.swing.JComponent.removeMouseWheelListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中javax.swing.JComponent.removeMouseWheelListener()方法的一些代码示例,展示了JComponent.removeMouseWheelListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.removeMouseWheelListener()方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:removeMouseWheelListener

JComponent.removeMouseWheelListener介绍

暂无

代码示例

代码示例来源:origin: Audiveris/audiveris

/**
 * Disconnect the provided component
 *
 * @param component the component to disconnect
 */
private void disconnectComponent (JComponent component)
{
  if (component != null) {
    component.removeMouseListener(this);
    component.removeMouseMotionListener(this);
    component.removeMouseWheelListener(this);
  }
}

代码示例来源:origin: RPTools/maptool

void removeListeners(JComponent comp) {
  if (comp == null) {
    return;
  }
  comp.removeKeyListener(this);
  if (this instanceof MouseListener) {
    comp.removeMouseListener((MouseListener) this);
  }
  if (this instanceof MouseMotionListener) {
    comp.removeMouseMotionListener((MouseMotionListener) this);
  }
  if (this instanceof MouseWheelListener) {
    comp.removeMouseWheelListener((MouseWheelListener) this);
  }
}

代码示例来源:origin: Audiveris/audiveris

/**
 * Actually register the rubber as the mouse listener for the provided component.
 *
 * @param component the related component
 */
public final void connectComponent (JComponent component)
{
  // Clean up if needed
  disconnectComponent(this.component);
  // Remember the related component (to get visible rect, etc ...)
  this.component = component;
  if (component != null) {
    // To be notified of mouse clicks
    component.removeMouseListener(this); // No multiple notifications
    component.addMouseListener(this);
    // To be notified of mouse mouvements
    component.removeMouseMotionListener(this); // No multiple notifs
    component.addMouseMotionListener(this);
    // To be notified of mouse  wheel mouvements
    component.removeMouseWheelListener(this); // No multiple notifs
    component.addMouseWheelListener(this);
  }
}

代码示例来源:origin: uk.co.caprica/vlcj

/**
 * Release the media player component and the associated native media player resources.
 */
public final void release() {
  onBeforeRelease();
  // It is safe to remove listeners like this even if none were added (depends on configured InputEvents in the
  // constructor)
  videoSurfaceComponent.removeMouseListener(this);
  videoSurfaceComponent.removeMouseMotionListener(this);
  videoSurfaceComponent.removeMouseWheelListener(this);
  videoSurfaceComponent.removeKeyListener(this);
  mediaPlayer.release();
  if (ownFactory) {
    mediaPlayerFactory.release();
  }
  onAfterRelease();
}

相关文章

JComponent类方法