mirror of
https://github.com/Stefan-5422/School-Programming-Projekt-022022.git
synced 2026-09-09 15:46:04 +02:00
Started add: UI
This commit is contained in:
@@ -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());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user