Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@RupprechJo
Created November 13, 2013 19:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RupprechJo/7455112 to your computer and use it in GitHub Desktop.
Save RupprechJo/7455112 to your computer and use it in GitHub Desktop.
Example for my blog
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Slider;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class ScalingDemo extends Application{
public void start(Stage primaryStage) throws Exception {
WebView webView = new WebView();
Slider slider = new Slider(0.5,2,1);
webView.scaleXProperty().bind(slider.valueProperty());
webView.scaleYProperty().bind(slider.valueProperty());
primaryStage.setScene(new Scene(new BorderPane(webView, null, null, slider, null)));
webView.getEngine().load("http://www.google.com");
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment