Solved

Tooltip duration

Posted on 2002-06-20
3
1,650 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Expert Comment

by:pran071199
ID: 7096276
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
ID: 7096316
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
ID: 7096932
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

690 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