1 package containers.borderPaneEx;
3 import javafx.application.Application;
4 import javafx.scene.Scene;
5 import javafx.scene.control.Label;
6 import javafx.scene.layout.BorderPane;
7 import javafx.scene.layout.Pane;
8 import javafx.stage.Stage;
21 public void start(Stage stage) {
23 BorderPane root =
new BorderPane();
24 Scene scene =
new Scene(root, 400, 400);
25 stage.setScene(scene);
26 stage.setTitle(
"BorderPane");
32 root.setBottom(
CenterText(
"alaosa",
"lightblue"));
33 root.setCenter(
CenterText(
"keskiosa",
"lightgray"));
34 }
catch (Exception e) {
44 public static void main(String[] args) {
55 public static Pane
CenterText(String teksti, String taustavari) {
56 BorderPane bp =
new BorderPane();
57 bp.setCenter(
new Label(teksti));
58 bp.setStyle(
"-fx-background-color: " + taustavari +
";");