Skip to content

Tooltips

weisj edited this page May 19, 2020 · 7 revisions

Tooltip API

The ToolTipContext class provides functionality to control tooltip position. This way tooltips with an anchored balloon like appearance are possible.

Darklaf provides a default context for any component that specifies its ToolTipConstants.KEY_STYLE value as ToolTipConstants.STYLE_BALOON (see Properties/JToolTip).

The default context will align the tooltip centered to the bottom edge of the component respecting the border insets. If the tooltip doesn't fit inside the current frame the position is based on whether it can be fit inside the current screen.

You can use a custom context by providing it through ToolTipConstants.KEY_CONTEXT property in combination with ToolTipConstants.KEY_STYLE = ToolTipConstants.STYLE_BALOON.

By default, buttons specify the ToolTipConstants.STYLE_BALOON style.

Examples

####setAlignInside(boolean) setAlignInside(true): Todo setAlignInside(false): Todo

####setToolTipInsets(Insets) Todo

####setIgnoreBorder(boolean) Todo

####setUseBestFot(boolean) Todo

####setToolTipRectSupplier(Function<MouseEvent, Rectangle>): Todo

####setApplyComponentInsetsToRect(boolean): Todo

####setInsideArea(Area) & setInsideArea(Rectangle) Todo

####setHideOnExit(boolean): setHideOnExit(false): Todo

setHideOnExit(true): Todo

See: ToolTipContext, ToolTipDemo

Clone this wiki locally