Solved

Tooltip duration

Posted on 2002-06-20
3
1,609 Views
Last Modified: 2007-11-27
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.
0
Comment
Question by:mzimmer74
  • 2
3 Comments
 
LVL 1

Expert Comment

by:pran071199
Comment Utility
Add this line to your Application
    ToolTipManager.sharedInstance().setDismissDelay(delaymsecs);

where delaymsecs is the number of milliseconds to delay  before taking away the tooltip
 
0
 
LVL 1

Accepted Solution

by:
pran071199 earned 50 total points
Comment Utility
Add this line to your Application
   ToolTipManager.sharedInstance().setDismissDelay(delaymsecs);

where delaymsecs is the number of milliseconds to delay  before taking away the tooltip.

You may not be able to display tooltip until mouse is moved off. But you can give a large delay so that the user can properly read it.



0
 
LVL 2

Author Comment

by:mzimmer74
Comment Utility
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now