JDK-8192059 : HTMLEditor fails to display text when editor is run from a Dialog
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 9,10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2017-11-29
  • Updated: 2018-12-03
  • Resolved: 2017-11-30
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Windows 10

A DESCRIPTION OF THE PROBLEM :
I'm having a problem displaying text in an HTMLEditor that is displayed in a JavaFX Dialog window.

OBJECTIVE: Display and edit text in an HTMLEditor that has been set to the content for the dialogPane in a Dialog window.

PROBLEM: The text in the HTMLEditor is invisible. It is there, but it cannot be seen.

CONCLUSION: The problem clearly has something to do with using HTMLEditor and Dialog together while running Java 9. I've used Dialog in the same way in other contexts without any problem, and the HTMLEditor in the demo app itself also functions properly. Also ��� and this is significant ��� the configuration described above (running HTMLEditor from a Dialog) runs fine under Java 8.


REGRESSION.  Last worked in version 8u144

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See "Source code for executable test case" in this form.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The HTMLEditor in the Dialog would display text that was set to its htmlText value when the dialog was created and displayed.
ACTUAL -
The HTMLEditor in the dialog does not display text. The text is there, but it is not visible. For example, if the editor is clicked when the dialog is displayed (this is apparently necessary to activate the dialog) and text is entered from the keyboard, the entered text will be returned from the dialog to the app's HTMLEditor when the dialog closes. This proves that the problem is making the text visible, and not whether the text is actually entered.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Code for an app that illustrates the problem can be found at:
https://stackoverflow.com/questions/47532260/why-does-javafx-htmleditor-not-display-text-where-editor-is-displayed-in-a-dialo

SOME SHORT NOTES ON HOW THE DEMO APP WORKS:
Both buttons have the same onAction value (actionHandler in the app code). Clicking either button initializes the dialog and dialogEditor before the dialog is displayed. If "Button#1" is clicked the htmlText for dialogEditor is initialized with the htmlText from appHtmlEditor. Clicking Button#2 initializes the dialogEditor with the sampleText value (which appears below the buttons). If the dialog is closed by clicking 'OK' the htmlText value for dialogEditor is returned and set to the htmlText for appHtmlEditor.

PROBLEM REPLICATED:
Clicking Button#2 displays the dialog, ... but without the sampleText appearing, although the sampleText is there because if the dialog is closed immediately by clicking the 'OK' button the htmlText from dialogEditor (which - again - is invisible) is returned and set to the htmlText value for appHtmlEditor, which causes that htmlText to change.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
none, ... but would be grateful if you have something to share!


Comments
This bug is not reproducible in JDK 10-ea+32.
30-11-2017

I note that the symptom is consistent with JDK-8190349 and both bugs were introduced in the same build,
29-11-2017

This might be related to JDK-8190349 which was recently fixed in JDK 10-ea+32
29-11-2017

Issue is reproducible (checked in windows 10). 8u144 : Pass 8u162-b01 : Pass 9+126 : Pass 9+127 : Fail <-- regression introduced here 9.0.1+11 : Fail 10-ea+31 : Fail In problematic cases - where text is not visible in HTMEditor, even if we type some text in dialogEditor and close the dialog, htmlText value in appHtmlEditor gets updated. So, editing functionality is working but the issue is that text is not visible in HTMLEditor when editor is inside some window (dialog or Stage).
29-11-2017