JDK-6178004 : REGRESSION: setToolTipText does not work if the component is not focussed
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0,5.0u1,6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,linux_2.6,windows_xp
  • CPU: generic,x86
  • Submitted: 2004-10-12
  • Updated: 2011-01-22
  • Resolved: 2006-05-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b86Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
1.5.0

ADDITIONAL OS VERSION INFORMATION :
Windows XP

EXTRA RELEVANT SYSTEM CONFIGURATION :
None

A DESCRIPTION OF THE PROBLEM :
The setTooltipText() nolonger works under 1.5, which works fine under 1.4. In order to show the tool tip text under 1.5, the panel where the component reside has to get focused.The following is a simple test program. If you comiple
and run this under 1.5 (Tiger), you'll see that tool tip text only shows up on the button where the jdialog gets focus. The tool tip text will not show on the button where the jdialog is not focused.

If you try the program using 1.4, both buttons will show the tool tip text regardless if the jdialog gets focus. This is certainly a bug in the basic GUI
component in 1.5 and should be fixed easily since it works under 1.4.

REPRODUCIBLE TESTCASE:
=====================================================
import java.awt.*; 
import java.awt.event.*; 
import javax.swing.event.*;
import javax.swing.*;


public class ToolTipTest extends JFrame 
{
	JDialog jdialog1, jdialog2;
	
   	public ToolTipTest()
	{
		jdialog1=new JDialog();
		jdialog2=new JDialog();
		jdialog1=new JDialog(this, false);
		jdialog1.setLocation(0,0);
		jdialog1.setSize(new Dimension(165, 240));

		jdialog2=new JDialog(this, false);
		jdialog2.setLocation(200,200);
		jdialog2.setSize(new Dimension(165, 240));
		JButton jbtn1=new JButton("Click Me");
		JButton jbtn2=new JButton("Click Me");

	
        jdialog1.getContentPane().add(jbtn1,BorderLayout.CENTER);
	    jdialog2.getContentPane().add(jbtn2,BorderLayout.CENTER);

		jbtn1.setToolTipText("Button1");
		jbtn2.setToolTipText("Button2");
		
		this.addWindowListener(new WindowAdapter()
		{
                    public void windowClosing(WindowEvent e)
                    {
                        System.exit (0);
                    }
                }
           	);
		this.pack(); 
		setVisible(true);
		jdialog1.setVisible(true);
		jdialog2.setVisible(true);

	}
	public static void main(String argv[]) 
	{ 
		new ToolTipTest();
	} 
}

REPRODUCIBILITY :
This bug can be reproduced always.

Release Regression From : 1.4.2
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 10/12/04 21:16 GMT

Comments
EVALUATION 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 "ToolTipManager.enableToolTipMode", "allWindows",
17-07-2007

EVALUATION To make it work and to prevent a bug 4727982 we need to have 6405841 fixed by AWT I have checked the native(both Windows and Linux) and found that most of the applications dont show tooltips if they are unfocused I incline to provide both possibilities when the tooltip are not shown for unfocused applications (default) and when tooltips are shown for all windows either focused or unfocused
03-04-2006

EVALUATION It is difficult to decide do we need to fix it or not Fixing can lead to regressions Commited to dolphin
10-10-2005

EVALUATION This seems to be a regression of the fix for #4148057
03-08-2005