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

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

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

JTree.setToolTipText介绍

暂无

代码示例

代码示例来源:origin: bcdev/beam

private void setToolTip(DefaultMutableTreeNode value, JTree tree) {
    int fileSize = ((OpendapLeaf) value.getUserObject()).getFileSize();
    tree.setToolTipText(OpendapUtils.format(fileSize / 1024.0) + " MB");
  }
}

代码示例来源:origin: bcdev/beam

public static void addCellRenderer(final JTree jTree) {
  final ImageIcon dapIcon = UIUtils.loadImageIcon("/org/esa/beam/opendap/images/icons/DRsProduct16.png", CatalogTree.class);
  final ImageIcon fileIcon = UIUtils.loadImageIcon("/org/esa/beam/opendap/images/icons/FRsProduct16.png", CatalogTree.class);
  final ImageIcon errorIcon = UIUtils.loadImageIcon("/org/esa/beam/opendap/images/icons/NoAccess16.png", CatalogTree.class);
  jTree.setToolTipText(null);
  jTree.setCellRenderer(new TreeCellRenderer(dapIcon, fileIcon, errorIcon));
}

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
                         boolean leaf, int row, boolean hasFocus) {
    componentBeingRendered = tree;
    Rectangle cellBounds = new Rectangle();
    if (!gettingCellBounds) {
      gettingCellBounds = true;
      cellBounds = tree.getRowBounds(row);
      gettingCellBounds = false;
    }
    setupLinkedObjectComponent(tree, cellBounds);
    preferredWidth = -1;
    minTextHeight = 12;
//        textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin));
    tree.setToolTipText(value != null ? value.toString() : "");
    Component c = prepareRenderer(value, selected, hasFocus);
    reset();
    return c;
  }

代码示例来源:origin: org.protege/protege-editor-owl

public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
                         boolean leaf, int row, boolean hasFocus) {
    componentBeingRendered = tree;
    Rectangle cellBounds = new Rectangle();
    if (!gettingCellBounds) {
      gettingCellBounds = true;
      cellBounds = tree.getRowBounds(row);
      gettingCellBounds = false;
    }
    setupLinkedObjectComponent(tree, cellBounds);
    preferredWidth = -1;
    minTextHeight = 12;
//        textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin));
    tree.setToolTipText(value != null ? value.toString() : "");
    Component c = prepareRenderer(value, selected, hasFocus);
    reset();
    return c;
  }

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
                         boolean leaf, int row, boolean hasFocus) {
    componentBeingRendered = tree;
    Rectangle cellBounds = new Rectangle();
    if (!gettingCellBounds) {
      gettingCellBounds = true;
      cellBounds = tree.getRowBounds(row);
      gettingCellBounds = false;
    }
    setupLinkedObjectComponent(tree, cellBounds);
    preferredWidth = -1;
    minTextHeight = 12;
//        textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin));
    tree.setToolTipText(value != null ? value.toString() : "");
    Component c = prepareRenderer(value, selected, hasFocus);
    reset();
    return c;
  }

代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing

public Object getCellEditorValue() {
  JCheckBox checkbox = renderer.getLeafRenderer();
  renderer.getNodoSeleccionable().setAllSelected(checkbox.isSelected());
  tree.setToolTipText(checkbox.getToolTipText());
  tree.repaint();
  return checkbox;
}

代码示例来源:origin: EngineHub/CommandHelper

keyTree.setToolTipText("");
keyTree.setRootVisible(false);
jScrollPane1.setViewportView(keyTree);

代码示例来源:origin: Waikato/weka-trunk

tree.setToolTipText("");

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

tree.setToolTipText("");

代码示例来源:origin: com.l2fprod.common/l2fprod-common-directorychooser

tree.setShowsRootHandles(false);
tree.setCellRenderer(new FileSystemTreeRenderer());
tree.setToolTipText("");

代码示例来源:origin: realXuJiang/bigtable-sql

root.removeAllChildren();
_tree.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
_tree.setToolTipText("init");

代码示例来源:origin: org.apache.directory.server/apacheds-xdbm-tools

tree.setBounds( new java.awt.Rectangle( 6, 184, 82, 80 ) );
tree.setShowsRootHandles( true );
tree.setToolTipText( "DB DIT" );
tree.setScrollsOnExpand( true );
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()

代码示例来源:origin: org.apache.directory/com.springsource.org.apache.directory.server.core

tree.setBounds( new java.awt.Rectangle( 6, 184, 82, 80 ) );
tree.setShowsRootHandles( true );
tree.setToolTipText( "DB DIT" );
tree.setScrollsOnExpand( true );
tree.getSelectionModel().addTreeSelectionListener( new TreeSelectionListener()

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

root.removeAllChildren();
_tree.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
_tree.setToolTipText("init");

代码示例来源:origin: bcdev/beam

@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
  if (CatalogTreeUtils.isDapNode(value)) {
    setLeafIcon(dapIcon);
    setToolTip(node, tree);
  } else if (CatalogTreeUtils.isFileNode(value)) {
    setLeafIcon(fileIcon);
    setToolTip(node, tree);
  } else try {
    if (leaf && isOpendapLeaf(node) && CatalogTreeUtils.getCatalogDatasets(node).isEmpty()) {
      setLeafIcon(errorIcon);
      tree.setToolTipText(null);
    } else {
      setLeafIcon(getClosedIcon());
    }
  } catch (IOException e) {
    setLeafIcon(errorIcon);
    tree.setToolTipText(null);
  }
  super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
  return this;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_componentTree.setToolTipText("");
m_componentTree.setRootVisible(false);
m_componentTree.setShowsRootHandles(true);

代码示例来源:origin: Waikato/weka-trunk

m_componentTree.setToolTipText("");
m_componentTree.setRootVisible(false);
m_componentTree.setShowsRootHandles(true);

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

resultTreeModel = new DefaultTreeModel(resultTreeRoot);
resultTree = new JTree(resultTreeModel);
resultTree.setToolTipText("");
resultTree.setCellRenderer(new ResultCellRenderer());
resultTree.setVisibleRowCount(16);

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

treevar.setToolTipText("");
treevar.setCellRenderer(getCellRenderer());
treevar.setRootVisible(false);

代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing

leafRenderer.setText(nodo.getName());
leafRenderer.setToolTipText(nodo.getDescription());
tree.setToolTipText(nodo.getDescription());

相关文章

JTree类方法