JDK-5047379 : tooltips have extra space at the end of the message
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0,1.4.2,5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS:
    generic,linux,linux_redhat_2.1,solaris_10,windows_2000 generic,linux,linux_redhat_2.1,solaris_10,windows_2000
  • CPU: generic,x86,sparc
  • Submitted: 2004-05-14
  • Updated: 2017-07-05
  • Resolved: 2005-09-20
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 b53Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Using tiger b50 on Solaris, the tooltips for all buttons on
ControlPanel have extra space at the end of its message.
See the attached image.

Comments
EVALUATION HTML tooltips have been fixed such that the shortcut key/accelerator is now being painted. Additionally, it was determined that it makes no sense to show the mnemonic binding in a tooltip. Therefore, the only time we'll show an accelerator key in the tooltip is if someone has added a WHEN_IN_FOCUSED_WINDOW binding to the component's InputMap.
30-08-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
25-09-2004

EVALUATION This is the way swing creates tooltips. I checked that there are no additional spaces at the end of tooltip strings. I am closing this as "not a bug". If you would still like to have this resolved, you should reopen this bug and change category to "swing", since this is not java_deployment bug. ###@###.### 2004-05-14 I can reproduce the bug as described (Solaris on CDE) with Tiger builds for as long as ControlPanel has been in the bin directory (at least back through b32). FWIW, I am using the C locale. Looking at the deployment source, I see that ControlPanel uses HTML tooltips. This bug is NOT seen in the SwingSet tooltip demo, nor in a standalone testcase which uses the same tooltip text as ControlPanel: --- // Test if there are layout problems w/ HTML tooltips import javax.swing.*; public class HTMLTest { public static void main(String[] args) { JFrame frame = new JFrame("HTMLTest"); JButton button = new JButton("Button"); button.setToolTipText("<html>" + "Close the Java Control Panel and" + "<br>save any changes you have made" + "</html>"); frame.add(button); frame.pack(); frame.setVisible(true); } } --- This indicates to me that there is some other factor in how the ControlPanel GUI is created that is causing this problem. ###@###.### 2004-07-13 Above is correct. Control Panel uses tooltip for buttons and other components that have shortcut keys set for them. SwingSet tooltip demo demonstrates the "pretty" aspect of tooltips vs. full functionality test. Here is a small, stand alone test case which demonstrates the problem observed in Control Panel - the extra space at the tooltip that uses HTML is actually invisible shortcut key (see tooltip for First and Second buttons): import java.awt.*; import javax.swing.*; public class Tooltip extends JDialog{ private JButton one, two; public Tooltip(){ super(); createPanel(); } private void createPanel(){ JPanel taPanel = new JPanel(); one = new JButton("First"); one.setMnemonic(java.awt.event.KeyEvent.VK_F); one.setToolTipText("Plain old tooltip"); two = new JButton("Second"); two.setMnemonic(java.awt.event.KeyEvent.VK_S); two.setToolTipText("<html>HTML tooltip</html>"); taPanel.add(one); taPanel.add(two); getContentPane().add(taPanel); } public static void main(String [] args){ Tooltip p = new Tooltip(); p.pack(); p.setVisible(true); } } Hope this excludes Control Panel from the suspects list. ###@###.### 2004-08-05
05-08-2004