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

HTML Tooltip with "img src=" on component doesn't show

    Details

    • Subcomponent:
    • Introduced In Version:
    • Resolved In Build:
      b14
    • CPU:
      x86_64
    • OS:
      windows_10

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        Operating System: Windows 10 Enterprise 64-bit (10.0, Build 16299) (16299.rs3_release_svc.180808-1748)
        Language: Danish (Regional Setting: Danish)
        System Manufacturer: LENOVO
        System Model: 20EGS07U00
        BIOS: Phoenix BIOS SC-T v2.1
        Processor: Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz (8 CPUs), ~2.8GHz
        Memory: 16384MB RAM
        Available OS Memory: 16010MB RAM
        Page File: 11052MB used, 8899MB available
        Windows Dir: C:\WINDOWS
        DirectX Version: DirectX 12
        User DPI Setting: 96 DPI (100 percent)
        System DPI Setting: 96 DPI (100 percent)
        DWM DPI Scaling: Enabled
        Miracast: Available, with HDCP
        Microsoft Graphics Hybrid: Supported
        Java version : 11.0.2

        A DESCRIPTION OF THE PROBLEM :
        If I set a tooltip on eg. a JTextField with HTML and img src for example "<html><img src=\"https://pbs.twimg.com/profile_images/1145865357/openjdk_400x400.png\"></html>", then tooltip won't show anything

        REGRESSION : Last worked in version 11.0.1

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Just set a tooltip on for example a Noneditable JTextfield with "<html><img src=\"https://pbs.twimg.com/profile_images/1145865357/openjdk_400x400.png\"></html>" and the image isn't show when mouse is over the textfield

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        I was expecting to have the image show in tooltip window, as it did in previous java versions eg. 11.0.1 or java 8 update 201
        ACTUAL -
        The image in tooltip isn't show when setting HTML tooltip: "<html><img src=\"https://pbs.twimg.com/profile_images/1145865357/openjdk_400x400.png\"></html>"

        ---------- BEGIN SOURCE ----------
        import java.awt.BorderLayout;

        import javax.swing.JFrame;
        import javax.swing.JPanel;
        import javax.swing.JTextField;
        import javax.swing.ToolTipManager;
        import javax.swing.WindowConstants;

        public class TestTooltip {

        public static void main(String[] args) {
        JFrame frame = new JFrame("Tooltip test");
        JPanel pane = new JPanel(new BorderLayout());
        JTextField textfield = new JTextField("text with tooltip");
        textfield.setEditable(false);
        ToolTipManager.sharedInstance().setInitialDelay(100);
        ToolTipManager.sharedInstance().setReshowDelay(100);
        textfield.setToolTipText("<html><img src=\"https://pbs.twimg.com/profile_images/1145865357/openjdk_400x400.png\"></html>");
        pane.add(textfield);
        frame.add(pane);
        frame.setSize(800, 600);
        frame.setLocationRelativeTo(frame);
        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        frame.setVisible(true);
        }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        I have not found any, so this is a serious problem for our customers, because they rely heavily on this feature.

        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kaddepalli Krishna Addepalli (Inactive)
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: