JDK-6529793 : Swing's default behavior should be to display tooltips when window lacks focus.
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-03-01
  • Updated: 2011-02-16
  • Resolved: 2007-07-17
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
When a swing window (such as a JFrame) is displayed on the user's desktop, but lacks interface focus, swing does not display tooltips when the mouse cursor hovers over the window. The constraint that the window must have interface focus for tooltips to be displayed is unnecessary and undesirable.

JUSTIFICATION :
The cost of spuriously displaying a tooltip that the user doesn't want to see is negligible - in most cases the user doesn't notice the tooltip, and in the few in which it blocks their view it is easily dismissed. By contrast, the failure to display a tooltip when it is desired is much greater - the user gets frustrated, impatient, and cannot be assumed to know that the reason the tooltip isn't displayed is because they have neglected to grant its window focus (usually requiring a click on the window's titlebar).

I believe the resolution of issue 6178004 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178004) is unsatisfactory because it does not take this into account. Furthermore, the comment "I have checked the native(both Windows and Linux) and found that most of the applications dont show tooltips if they are unfocused" is not in and of itself a justification for making the default behavior focused-window-only. 

And, for what it's worth, of the applications open on my desktop right now, Firefox, Winamp, IntelliJ IDEA, Gaim, Acrobat Reader, and The GIMP all show tooltips while hovering over unfocused windows, whereas only Microsoft Outlook and Windows Explorer show tooltips only when holding interface focus.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Swing's default behavior should be to always display tooltips without regard to whether the window from which the tooltip being generated has focus. Should applications wish to only display tooltips when holding interface focus, this exceptional behavior should have to be specifically requested.

CUSTOMER SUBMITTED WORKAROUND :
None for JDK 5.0, not even the solution described in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178004 .

Comments
EVALUATION The bug 6178004 was fixed for JDK 6 we didn't backport it to JDK 5 yet there is a new UI property: // ToolTipManager.enableToolTipMode currently supports: // "allWindows" (default): // enables tool tips for all windows of all java applications, // whether the windows are active or inactive // "activeApplication" // enables tool tips for windows of an application only when // the application has an active window the MetalLaf and WindowsLaf overload this property and set it to "activeApplication" when GTK LaF use "allWindows" by default if you want to switch to "allWindows" mode, just do UIManager.put("ToolTipManager.enableToolTipMode", "allWindows"); at the very beginning of your program
17-07-2007