Started add: UI

This commit is contained in:
Stefan-5422
2022-02-25 11:38:58 +01:00
parent 1c7b8dba1b
commit c170f324fe
2 changed files with 48 additions and 0 deletions
@@ -0,0 +1,18 @@
package com.yes.yes.managers;
import com.yes.yes.ui.BuildBox;
import javafx.scene.layout.VBox;
public class UiManager {
VBox root;
BuildBox buildBox;
public UiManager(VBox root) {
this.root = root;
}
public void initialize() {
buildBox = new BuildBox();
root.getChildren().add(0,buildBox);
}
}
@@ -0,0 +1,30 @@
package com.yes.yes.ui;
import javafx.application.Platform;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.HBox;
public class BuildBox
extends javafx.scene.Group {
public BuildBox() {
ScrollPane pane = new ScrollPane();
HBox hbox = new HBox();
hbox.prefHeight(100);
hbox.maxHeight(100);
hbox.prefWidth(Double.POSITIVE_INFINITY);
pane.setContent(hbox);
this.getChildren().add(pane);
Platform.runLater(() ->
{
pane.prefWidthProperty()
.bind(this.getScene()
.getWindow()
.widthProperty());
}
);
}
}