JDK-8218674 : HTML Tooltip with "img src=" on component doesn't show
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u202,11.0.2,12,13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-02-06
  • Updated: 2020-08-05
  • Resolved: 2019-03-07
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 11 JDK 13 JDK 8 Other
11.0.4-oracleFixed 13 b14Fixed 8u212Fixed openjdk8u222Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
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



Comments
Fix Request 8u. This patch fixes a regression introduced in 8u202. Patch applies cleanly net of directory names and line numbers.
08-05-2019

Fix Request 11u. This patch fixes a regression introduced in 11.0.2. Patch applies cleanly.
08-05-2019

Seems like regression of JDK-8208638
11-02-2019

Reported against JDK 11.0.2 were HTML Tooltip with "img src=" on component doesn't show up. Checked this with respective JDK version and could confirm the issue as reported. Results: ======== 8u201: Pass 11.0.1: Pass 11.0.2: Fail 12 ea b30: Fail 13 ea b07: Fail This is a regression introduced in JDK 11.0.2. To verify, run the attached test case with respective JDK versions.
08-02-2019