Is it possible to change delays that affect appearing, keeping and disappearing of tooltip?
4660 Since 25th November, 2003
Select and Copy the Code
The ToolTipManager is a service class that maintains a shared instance registered with AppContext. We
can access the ToolTipManager directly by calling its static sharedInstance() method:
ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
Internally this class uses three non-repeating Timers with delay times defaulting to 750, 500, and 4000.
ToolTipManager uses these Timerís in coordination with mouse listeners to determine if and when to
display a JToolTip with a componentís specified tooltip text. When the mouse enters a components
will detect this and wait 750ms until displaying a JToolTip for that component. This is referred to as the
initial delay time.
A JToolTip will stay visible for 4000ms or until we move the mouse outside of that componentís bounds,
whichever comes first. This is referred to as the dismiss delay time. The 500ms Timer represents the
reshow delay time which specifies how soon the JToolTip we have just seen will appear again when this
component is re-entered.
Each of these delay times can be set using ToolTipManagerís setDismissDelay(), setInitialDelay(), and
ToolTipManager is a very nice service to have implemented for us, but it does have significant
limitations. When we construct our polygonal buttons we will find that it is not robust enough to support non-rectangular components.