This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am working with a desktop application. I have got JButtons with letters from A to Z over which I want Tooltips to display the number of files classified under each letter. The file names are stored in a HashMap<String, List<String>>. The HashMap is instantiated and loaded with data before the JButtons are instantiated. Most of the time the tooltips display the corrected number of files, but occasionally they display zero number of files. On rare occasions there is no tooltip whatsoever!! I am using Jyloo's Synthetica Look And Feel but I doubt it has anything to do with this, because I did a test with the Nimbus Look And Feel provided by default with Java.
I don't think its a good idea to set a toolTipText in a mouseEntered event. For a toolTipText that might vary each time the component is moused over, I would override getToolTipText() instead.(Untested)
Shouldn't alphaButton be declared final in the code you posted?
edit You may or may not need to register the button with the ToolTipManager.
There are no new questions, but there may be new answers.