private void _resize(final double width, final double height) {
Window window = container.getScene().getWindow();
double diffY = window.getHeight() - container.getHeight();
double diffX = window.getWidth() - container.getWidth();
webView.setMaxWidth(width);
webView.setMaxHeight(height);
webView.setMinWidth(width);
webView.setMinHeight(height);
javafx.geometry.Rectangle2D screenBounds = Screen.getPrimary().getBounds();
double scaleX = screenBounds.getWidth() / ( width + diffX );
double scaleY = screenBounds.getHeight() / ( height + diffY );
double scale = Math.min(Math.min(scaleX, scaleY), 1.1) - .1;
webView.setScaleX(scale);
webView.setScaleY(scale);
container.getScene().setRoot(new Group());
((Stage)window).setScene(new Scene(container, width * scale, height * scale));
}