List of usage examples for javax.swing JToolTip getTipText
public String getTipText()
From source file:com.haulmont.cuba.desktop.sys.DesktopToolTipManager.java
protected void showTooltip(JComponent field, String text) { if (!field.isShowing()) return;//from w w w. j a va2 s. c o m if (StringUtils.isEmpty(text)) { return; } PointerInfo pointerInfo = MouseInfo.getPointerInfo(); if (pointerInfo == null) { return; } if (toolTipWindow != null) { hideTooltip(); } component = field; final JToolTip toolTip = new CubaToolTip(); toolTip.setTipText(text); // Location to display tooltip Point location = getToolTipLocation(pointerInfo, toolTip.getTipText()); final Popup tooltipContainer = PopupFactory.getSharedInstance().getPopup(field, toolTip, location.x, location.y); tooltipContainer.show(); window = tooltipContainer; toolTipWindow = toolTip; tooltipShowing = true; if (!(field instanceof ToolTipButton)) { toolTip.addMouseListener(this); field.addMouseListener(this); } }
From source file:org.underworldlabs.swing.plaf.base.AcceleratorToolTipUI.java
private String getTipText(JToolTip tip) { String text = tip.getTipText(); if (text == null) { text = Constants.EMPTY;//from w w w .j a v a2s . co m } return text; }