I am trying to embed CodeMirror js editor in a Webview, borrowing heavily from the code that I located from this post. http://github.com/jewelsea/conception
JavaFX code editor with content highlighter for Java Code
Here is the html template
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
<link rel="stylesheet" href="http://codemirror.net/theme/cobalt.css">
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/mode/sql/sql.js"></script>
</head>
<body>
<form>
<textarea id="code" name="code">--This is code inside the SQLTtool; INSERT INTO thing ${code}</textarea>
</form>
<script> var editor = CodeMirror.fromTextArea(document.getElementById("code"), { lineNumbers: true, matchBrackets: true, mode: "text/x-mssql", lineWrapping: true, theme: "cobalt"});
</script>
</body>
</html>
Firefox Render

Webview Render

Admittedly, I don't really know what I'm doing here as I'm new to JavaFX and have no experience with JavaScript. Any ideas?
Env
Win 7 64
java version "1.8.0_40" Java(TM) SE Runtime Environment (build 1.8.0_40-b25) Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
Code
(I've stripped the code from the Conception project down to a more basic setup)
@Override
public void start(Stage stage) throws Exception {
//set-up window
stage.setTitle("SQL Tool");
stage.setMinWidth(800);
stage.setMinHeight(600);
stage.setScene(createScene());
stage.show();
}
private Scene createScene() throws IOException{
final AnchorPane ap1 = new AnchorPane(createButton());
final AnchorPane ap2 = new AnchorPane(createWebView());
ap2.setBackground(new Background(new BackgroundFill(Color.AZURE,CornerRadii.EMPTY,Insets.EMPTY)));
Scene scene = new Scene(layoutScene(
ap1,
ap2
));
return scene;
}
private WebView createWebView() throws IOException{
String template = Resources.toString(getResource("codemirror.html"), Charsets.UTF_8);
WebView webview = new WebView();
webview.getEngine().loadContent(template);
AnchorPane.setLeftAnchor(webview, 10.0);
AnchorPane.setRightAnchor(webview, 10.0);
AnchorPane.setBottomAnchor(webview, 10.0);
AnchorPane.setTopAnchor(webview, 10.0);
return webview;
}
//set-up primary layout
private SplitPane layoutScene(Node... nodes) {
final SplitPane layout = new SplitPane();
layout.setOrientation(Orientation.VERTICAL);
layout.setDividerPositions(.4f);
layout.getItems().addAll(nodes);
return layout;
}
private URL getResource(String name) {
return getClass().getResource("resources/" + name);
}