Solved

Tooltip duration

Posted on 2002-06-20
3
1,634 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat startup error 5 102
Unhandled exception type Exception 18 42
by zero exception 10 52
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 56
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

840 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