toolTip

Sets the tooltip for the whole component. null clears it.

The last toolTip declaration wins across both overloads. Use the per-location overload for a tooltip that depends on the pointer's location. ToolTipManager controls when the tooltip appears and how long it stays.

Parameters

text

the tooltip for the whole component.

See also


fun SwingComponentStyleScope.toolTip(text: (event: MouseEvent) -> @Nls String?)

Sets the tooltip for the pointer's location. text returns null where no tooltip is available.

text receives the pointer's MouseEvent before the tooltip appears, and its answer becomes the component's tooltip text, so keep it free of side effects. It runs on every pointer move, so keep it inexpensive. These tooltips work even when the component has no plain tooltip text.

Parameters

text

returns the tooltip at the event's location. It runs on the event dispatch thread and must not block.

See also