javax.swing.JTree.addComponentListener()方法的使用及代码示例

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

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

JTree.addComponentListener介绍

暂无

代码示例

代码示例来源:origin: org.nuiton/nuiton-widgets

/**
 * Enable data tips for a tree component.
 * @param tree the tree which should be enhanced with data tips.
 */
public synchronized void register(JTree tree) {
  tree.addMouseListener(treeMouseListener);
  tree.addMouseMotionListener(treeMouseListener);
  tree.addComponentListener(treeMouseListener);
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

/**
 * Enable data tips for a tree component.
 *
 * @param tree the tree which should be enhanced with data tips.
 */
public synchronized void register(JTree tree) {
  tree.addMouseListener(treeMouseListener);
  tree.addMouseMotionListener(treeMouseListener);
  tree.addComponentListener(treeMouseListener);
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

private void attach() {
  if (tree != null) {
    tree.getModel().addTreeModelListener(this);
    tree.getSelectionModel().addTreeSelectionListener(this);
    tree.addHierarchyBoundsListener(this);
    tree.addHierarchyListener(this);
    tree.addComponentListener(this);
  } else {
    list.getSelectionModel().addListSelectionListener(this);
    list.getModel().addListDataListener(this);
    list.addHierarchyBoundsListener(this);
    list.addHierarchyListener(this);
    list.addComponentListener(this);
  }
  pane.getHorizontalScrollBar().getModel().addChangeListener(this);
  pane.getVerticalScrollBar().getModel().addChangeListener(this);
  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(this);
}

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

private void attach() {
  if (tree != null) {
    tree.getModel().addTreeModelListener(this);
    tree.getSelectionModel().addTreeSelectionListener(this);
    tree.addHierarchyBoundsListener(this);
    tree.addHierarchyListener(this);
    tree.addComponentListener(this);
  } else {
    list.getSelectionModel().addListSelectionListener(this);
    list.getModel().addListDataListener(this);
    list.addHierarchyBoundsListener(this);
    list.addHierarchyListener(this);
    list.addComponentListener(this);
  }
  if(null!=pane.getHorizontalScrollBar())
  {
    pane.getHorizontalScrollBar().getModel().addChangeListener(this);
  }
  if(null!=pane.getVerticalScrollBar())
  {
    pane.getVerticalScrollBar().getModel().addChangeListener(this);
  }
  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(this);
}

代码示例来源:origin: org.orbisgis/mapeditor

/**
 * Notifies this component that it now has a parent component. When this
 * method is invoked, the chain of parent components is set up with
 * KeyboardAction event listeners.
 */
@Override
public void addNotify() {
    super.addNotify();
    if (!initialised.getAndSet(true)) {
        addComponentListener(sizeListener);
        // Read the default map context file
        initMapContext();
        //Register listener
        dragDropHandler.getTransferEditableEvent().addListener(this, EventHandler.create(EditableTransferListener.class, this, "onDropEditable", "editableList"));
        mapControl.addMouseMotionListener(EventHandler.create(MouseMotionListener.class, this, "onMouseMove", "point", "mouseMoved"));
        mapStatusBar.addVetoableChangeListener(
            MapStatusBar.PROP_USER_DEFINED_SCALE_DENOMINATOR,
            EventHandler.create(VetoableChangeListener.class, this,
            "onUserSetScaleDenominator", ""));
        // When the tree is expanded update the manager size
        mapsManager.getTree().addComponentListener(sizeListener);
        mapsManager.getTree().addTreeExpansionListener(EventHandler.create(TreeExpansionListener.class,this,"updateMapControlSize"));
    }
}

相关文章

JTree类方法