Java Reference
In-Depth Information
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.web.WebView?>
<VBox maxHeight="-Infinity"
maxWidth="-Infinity"
minHeight="-Infinity"
minWidth="-Infinity"
prefHeight="400.0"
prefWidth="600.0"
spacing="10.0"
xmlns=" http://javafx.com/javafx/8 "
xmlns:fx=" http://javafx.com/fxml/1 ">
<fx:script>
function actionHandler(event) {
webView.getEngine().load(address.getText());
}
</fx:script>
<children>
<HBox spacing="10.0">
<children>
<TextField fx:id="address"
onAction="actionHandler(event)"
HBox.hgrow="ALWAYS">
<padding>
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0"/>
</padding>
</TextField>
<Button fx:id="loadButton"
mnemonicParsing="false"
onAction="actionHandler(event)"
text="Load"/>
</children>
</HBox>
<WebView fx:id="webView"
prefHeight="200.0"
prefWidth="200.0"
VBox.vgrow="ALWAYS"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</VBox>
Listing 3-30. ScriptingExample.java
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
Search WWH ::




Custom Search