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

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

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

JComponent.getMouseListeners介绍

暂无

代码示例

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-component-fields

/**
 * Remove all mouse listeners from a component.
 *
 * @param c The component from which to remove MouseListeners.
 */
protected static void removeMouseListeners(JComponent c) {
  for (MouseListener ml : c.getMouseListeners()) {
    c.removeMouseListener(ml);
  }
}

代码示例来源:origin: sdedit/sdedit

private void inheritListeners() {
  mouseListeners.clear();
  mouseMotionListeners.clear();
  if (viewPort != null) {
    mouseListeners.addAll(Arrays.asList(viewPort.asJComponent()
        .getMouseListeners()));
    mouseMotionListeners.addAll(Arrays.asList(viewPort.asJComponent()
        .getMouseMotionListeners()));
  }
}

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

private static void removeDndSource(final JComponent _c) {
 _c.putClientProperty("DND_SOURCE", null);
 final MouseListener[] ls = _c.getMouseListeners();
 if (ls != null) {
  for (int i = ls.length - 1; i >= 0; i--) {
   if (ls[i] instanceof DndSource) {
    _c.removeMouseListener(ls[i]);
    _c.removeMouseMotionListener((DndSource) ls[i]);
   }
  }
 }
}

代码示例来源:origin: datacleaner/DataCleaner

if (component.getMouseListeners().length == 0) {
  component.addMouseListener(new MouseAdapter() {
    @Override

相关文章

JComponent类方法