javax.swing.JScrollPane.removeMouseListener()方法的使用及代码示例

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

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

JScrollPane.removeMouseListener介绍

暂无

代码示例

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

public static void setAutoScrollEnabled(final JScrollPane scrollPane,
    boolean isEnabled) {
  if (isEnabled) {
    new AutoScrollActivator(scrollPane);
  } else {
    for (MouseListener mouseListener : scrollPane.getMouseListeners()) {
      if (mouseListener instanceof AutoScrollMouseListener) {
        scrollPane.removeMouseListener(mouseListener);
        return;
      }
    }
  }
}

代码示例来源:origin: in.jlibs/org-netbeans-swing-outline

/**
 * This method update mouse listener on the scrollPane if it is needed.
 * It also recomputes the model of searchCombo. Both actions are needed after
 * the set of visible columns is changed.
 */
void updateColumnSelectionMouseListener() {
  Container p = getParent();
  if (p instanceof JViewport) {
    Container gp = p.getParent();
    if (gp instanceof JScrollPane) {
      JScrollPane scrollPane = (JScrollPane)gp;
      // Make certain we are the viewPort's view and not, for
      // example, the rowHeaderView of the scrollPane -
      // an implementor of fixed columns might do this.
      JViewport viewport = scrollPane.getViewport();
      if (viewport == null || viewport.getView() != this) {
        return;
      }
      scrollPane.removeMouseListener(columnSelectionMouseListener);
      if (getColumnModel().getColumnCount() == 0) {
        scrollPane.addMouseListener(columnSelectionMouseListener);
      }
    }
  }
  if (searchCombo != null) {
    searchCombo.setModel(getSearchComboModel());
  }
}

相关文章

JScrollPane类方法