You could extend JToolTip. Create a runnable and run it when the tooltip gets displayed... then from there change the tips (which you could have added to a list)..... all inside of an extended JToolTip class.
quite alot work for a small feature :)
but reusuable.. so mabe its worth the time ...
Well you extend JToolTip and override a method that the GUI manager calls to display JToolTips.... im not sure maybe "setVisible" (deept down from Container..)...
from such a method call super(); to make sure we still have the original functionality and then add code to make a thread that changes the tips
by putting an instance of a class you create on the event dispatching thread via invokeLater...
a updating class would look basicly like this
class TipUpdater implements runnable{
//fields here
public TipUpdater(JToolTip refferenceToYourToolTip){
//set fields=parameter}
public void run(){
// loop here fetching strings from your tooltip list and change refferenceToYourToolTip.setToolTip(string);
}
};
Ok, i cant go much more into detail because i would have to go now and try it if/how it works... i hope this was a little help and gave you a basic idea to start from...
Swing Api JToolTip:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JToolTip.html
Message was edited by:
jEti182
Use a MouseListener. When mouseEntered event is generated you start a Timer that fires every 2 seconds. In the timer code you use component.setToolTipText(...) and this should refresh the tooltip. Then on mouseExited event you stop the timer.
You may also need to play with the ToolTipManager to keep the tooltip from hiding after the default time period.