java - Is WebView "embeddable" in TextFlow? -


it says on openjdk samples textflow can have arbitrary nodes children, e.g. button. wondering if webview can possible child? if so, must doing wrong. when add textflow, webview takes space, displays nothing. content i've tried range simple html pages, videos services youtube.

since control new, unable find existing use case online.

in case you're wondering why want this. have listview displays rich content. if textflow capable of displaying node, save me creating multiple extension classes different types want display on listview (e.g. video, formatted text, html - these did, , work fine), , can manage content managing textflow's children.

thanks.

yes, can. note web view layout out using baselineoffset, not going appropriate use in textflow (i think happens it's bottom edge aligned bottom edge of text, , gets clipped height of text row.) can around wrapping in group:

import javafx.application.application; import javafx.scene.group; import javafx.scene.scene; import javafx.scene.text.text; import javafx.scene.text.textflow; import javafx.scene.web.webview; import javafx.stage.stage;  public class webviewintextflow extends application {      @override     public void start(stage primarystage) {         textflow flow = new textflow();          webview webview = new webview();         webview.getengine().getloadworker().stateproperty().addlistener((obs, oldstate, newstate) -> system.out.println(newstate));         webview.getengine().load("http://stackoverflow.com/questions/31353921/is-webview-embeddable-in-textflow/31357609#31357609");           flow.getchildren().addall(new text("some text"), new group(webview), new text("some more text"));          primarystage.setscene(new scene(flow, 800, 800));         primarystage.show();     }      public static void main(string[] args) {         launch(args);     } } 

enter image description here


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -