Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6552957

Using HTML in tooltip leaves a white line in right and left sides

XMLWordPrintable

        FULL PRODUCT VERSION :
        java version "1.6.0"
        Java(TM) SE Runtime Environment (build 1.6.0-b105)
        Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows 2000 [Version 5.00.2195]

        A DESCRIPTION OF THE PROBLEM :
        JRE 1.6 shows a white line on both left and right side of a tooltip text. This happens only when the background colour of the tooltip is changed to a different colour. No issues in JRE 1.5 or before.

        Example:
        String strTooltipText = "<html><body bgcolor='#18AFE5'><strong>HELP:</strong>&nbsp;<BR><HR>";
        strTooltipText += "&nbsp;<strong>This is the help text</strong><BR></body></html>";

        component.setToolTipText(strTooltipText);

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

        Set a tooltip for a Swing Component with a different background colour using HTML. You would see a white line in both left and right side of the tooltip.

        Example:
        String strTooltipText = "<html><body bgcolor='#B8CFE5'><strong>HELP:</strong>&nbsp;<BR><HR>";
        strTooltipText += "&nbsp;<strong>This is the help text</strong><BR></body></html>";

        component.setToolTipText(strTooltipText);

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        No white border should appear on either side.
        ACTUAL -
        You would see a white border in both left and right side of the tooltip.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        Example:
        String strTooltipText = "<html><body bgcolor='#B8CFE5'><strong>HELP:</strong>&nbsp;<BR><HR>";
        strTooltipText += "&nbsp;<strong>This is the help text</strong><BR></body></html>";

        component.setToolTipText(strTooltipText);
        ---------- END SOURCE ----------

        Release Regression From : 5.0u11
        The above release value was the last known release where this
        bug was not reproducible. Since then there has been a regression.

              alexp Alexander Potochkin (Inactive)
              ryeung Roger Yeung (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: