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

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

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

JComponent.createToolTip介绍

暂无

代码示例

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

@Override
public JToolTip createToolTip() {
  if (component instanceof JComponent) {
    return ((JComponent) component).createToolTip();
  } else {
    return super.createToolTip();
  }
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Returns the tooltip instance to use for this Display. By default, uses
 * the normal Swing tooltips, returning the result of this same method
 * invoked on the JComponent super-class. If a custom tooltip has been
 * set, that is returned instead.
 * @see #setCustomToolTip(JToolTip)
 * @see javax.swing.JComponent#createToolTip()
 */
public JToolTip createToolTip() {
  if ( m_customToolTip == null ) {
    return super.createToolTip();
  } else {
    return m_customToolTip;
  }
}

代码示例来源:origin: xyz.cofe/docking-frames-core

public JToolTip createTooltip( Component component, TooltipStrategyCallback callback ){
    if( component instanceof JComponent ){
      return ((JComponent)component).createToolTip();
    }
    else{
      return callback.createToolTip();
    }
  }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

public JToolTip createTooltip( Component component, TooltipStrategyCallback callback ){
    if( component instanceof JComponent ){
      return ((JComponent)component).createToolTip();
    }
    else{
      return callback.createToolTip();
    }
  }
}

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

private void showTipWindow() {
  Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
  if (insideComponent == null || !insideComponent.isShowing() || focusOwner == null)
    return;
  tip = insideComponent.createToolTip();
  tip.setTipText(toolTipText);
  final JComponent nearComponent = insideComponent;
  focusOwnerRef = new WeakReference<Component>(focusOwner);
  tipPopup = new JPopupMenu();
  tipPopup.setLayout(new GridLayout(1, 1));
  tipPopup.add(tip);
  mouseInsideTooltipListener = new MouseInsideListener(tipPopup);
  final Component placedComponent = tipPopup;
  Point location = UITools.findBestLocation(placedComponent, nearComponent);
  SwingUtilities.convertPointFromScreen(location, nearComponent);
   tipPopup.show(nearComponent, location.x, location.y);
  focusOwner.requestFocusInWindow();
  exitTimer.start();
}

代码示例来源:origin: stackoverflow.com

panel.createToolTip().setDoubleBuffered(true);

代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

tip = insideComponent.createToolTip();
tip.setTipText(toolTipText);
size = tip.getPreferredSize();

相关文章

JComponent类方法