I have created very simple app that is displaying URL using JavaFX WebView:
static JFXPanel fxPanel;
static WebView wv;
static JFrame frame;
public static void main(String[] args){
try {
fxPanel = new JFXPanel ();
com.sun.javafx.application.PlatformImpl.runLater ( new Runnable () {
@Override
public void run () {
wv = new WebView ();
wv.getEngine ().load ( "http://localhost:8080/WebApp/" );
fxPanel.setScene ( new Scene ( wv, 1000, 750 ) );
frame = new JFrame ( "Google" );
frame.add ( new JScrollPane ( fxPanel ) );
frame.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
frame.setVisible ( true );
frame.pack ();
}
} );
} catch ( Exception ex ) {
}
I use it to render a webpage with my JSF application. App renders perfectly using a web browser, however it fails when rendered from JFXPanel.
Funny thing is that texts fetched from backing beans are not rendered correctly, where resources from message bundle are displayed OK. Please see attached screenshots.Wrong Display and Correct Display