Path caretPath = new Path();
caretPath.setManaged(false);
caretPath.setStrokeWidth(1);
caretPath.setFill((Color.BLACK));
caretPath.setStroke((Color.BLACK));
caretPath.visibleProperty().bind(caretVisible);
stack = new RegionImpl(flow,caretPath);
setGraphic(stack);
} else {
flow = (TextFlow) stack.getChildren().get(0);
}