Link to home
Start Free TrialLog in
Avatar of mzimmer74
mzimmer74

asked on

Tooltip duration

Hey all,

does anybody know if there is a way to set the duration a tooltip stays on a swing gui?  I have some custom components that I'm using the built in tooltip functionality of JComponent (ie using setTooltipText) but I don't like the fact that the tip only stays for a few seconds.  What I'd really like is the ability to have it stay up until they move the mouse off of the component.  Any thoughts on this?

Thanks.
Avatar of pran071199
pran071199

Add this line to your Application
    ToolTipManager.sharedInstance().setDismissDelay(delaymsecs);

where delaymsecs is the number of milliseconds to delay  before taking away the tooltip
 
ASKER CERTIFIED SOLUTION
Avatar of pran071199
pran071199

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mzimmer74

ASKER

Thanks, that solved my problem well enough.  However, do you know if there is any way to make it so some tooltips have different durations?  I'd really like to make only the tool tips in one portion of my program have long durations and the rest have the standard time.  Is this possible or not?  Thanks.