diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-05-18 08:51:31 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-05-18 08:51:31 -0400 |
commit | fe9794bdc8270b43ed5ae847d65ea2a2eecd4a79 (patch) | |
tree | 6417e66b2de9f67647ae9e0d6b853858da466275 /src/gui/LevelSelector.java | |
parent | bbad14a33c614ac3480c599dd72a06e14a86295c (diff) | |
download | NPEhero-fe9794bdc8270b43ed5ae847d65ea2a2eecd4a79.tar.gz NPEhero-fe9794bdc8270b43ed5ae847d65ea2a2eecd4a79.tar.bz2 NPEhero-fe9794bdc8270b43ed5ae847d65ea2a2eecd4a79.zip |
fix resizing and the bottom being too long
Diffstat (limited to 'src/gui/LevelSelector.java')
-rw-r--r-- | src/gui/LevelSelector.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/LevelSelector.java b/src/gui/LevelSelector.java index 5600b07..9ae6033 100644 --- a/src/gui/LevelSelector.java +++ b/src/gui/LevelSelector.java @@ -21,8 +21,8 @@ public class LevelSelector extends Pane ListView<String> levels = new ListView<String>(); ObservableList<String> levelList= FXCollections.observableArrayList ("Test Level 1", "Test Level 2", "Test Level 3", "Test Level 4"); levels.setItems(levelList); - levels.minWidthProperty().bind(super.widthProperty().multiply(0.25)); - levels.minHeightProperty().bind(super.heightProperty().multiply(0.75)); + levels.prefWidthProperty().bind(super.prefWidthProperty().multiply(0.25)); + levels.prefHeightProperty().bind(super.prefHeightProperty().multiply(0.75)); Button exit = new Button(); exit.setText("Exit"); @@ -38,8 +38,8 @@ public class LevelSelector extends Pane HBox rootBox = new HBox(); - rootBox.minWidthProperty().bind(super.widthProperty()); - rootBox.minHeightProperty().bind(super.heightProperty()); + rootBox.prefWidthProperty().bind(super.prefWidthProperty()); + rootBox.prefHeightProperty().bind(super.prefHeightProperty()); rootBox.getChildren().addAll(leftBox, rightBox); rootBox.setAlignment(Pos.CENTER); rootBox.setSpacing(10); @@ -56,10 +56,10 @@ public class LevelSelector extends Pane rightBox.getChildren().remove(0); } rightBox.getChildren().add(details); - details.minWidthProperty().bind(super.widthProperty().multiply(0.37)); - details.minHeightProperty().bind(super.heightProperty()); - details.maxWidthProperty().bind(super.widthProperty().multiply(0.37)); - details.maxHeightProperty().bind(super.heightProperty()); + details.prefWidthProperty().bind(super.prefWidthProperty().multiply(0.37)); + details.prefHeightProperty().bind(super.prefHeightProperty()); + details.maxWidthProperty().bind(super.prefWidthProperty().multiply(0.37)); + details.maxHeightProperty().bind(super.prefHeightProperty()); } } |