Created
November 13, 2013 19:43
-
-
Save RupprechJo/7455112 to your computer and use it in GitHub Desktop.
Example for my blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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