Java Code Examples for javax.swing.JComponent.getToolTipText()

The following are Jave code examples for showing how to use getToolTipText() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: incubator-netbeans   File: RendererPanel.java   View Source Code Vote up 5 votes
@Override
public String getToolTipText(MouseEvent event) {
    Component c = SwingUtilities.getDeepestComponentAt(this, event.getX(), event.getY());
    if (c instanceof JComponent) {
        JComponent jc = (JComponent) c;
        String tooltip = jc.getToolTipText();
        if (null != tooltip) {
            return tooltip;
        }
    }
    return super.getToolTipText(event);
}
 
Example 2
Project: incubator-netbeans   File: ListRendererPanel.java   View Source Code Vote up 5 votes
@Override
public String getToolTipText(MouseEvent event) {
    Component c = SwingUtilities.getDeepestComponentAt(this, event.getX(), event.getY());
    if (c instanceof JComponent) {
        JComponent jc = (JComponent) c;
        String tooltip = jc.getToolTipText();
        if (null != tooltip) {
            return tooltip;
        }
    }
    return super.getToolTipText(event);
}
 
Example 3
Project: incubator-netbeans   File: SummaryCellRenderer.java   View Source Code Vote up 5 votes
@Override
public boolean mouseMoved (Point p, JComponent component) {
    if (bounds != null && component.getToolTipText() == null) {
        for (Rectangle b : bounds) {
            if (b.contains(p)) {
                component.setToolTipText(text);
                return true;
            }
        }
    }
    return false;
}