Trying different layouts

This commit is contained in:
FUH22860 2022-05-03 12:44:31 +02:00
parent df420ea81b
commit 4d488b419c

View File

@ -1,5 +1,9 @@
package application; package application;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.geometry.VPos;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
@ -10,9 +14,9 @@ public class RootGridPane extends GridPane {
// Button btLaden; // Button btLaden;
// Button btSpeichern; // Button btSpeichern;
Button btButton1, btLaden, btSpeichern; private Button btButton1, btLaden, btSpeichern;
Button btButton4, btButton5, btButton6, btButtonSieben, btButtonAcht; private Button btButton4, btButton5, btButton6, btButtonSieben, btButtonAcht;
FlowPane fpRechtsUnten; private FlowPane fpRechtsUnten;
public RootGridPane() { public RootGridPane() {
initComponents(); initComponents();
@ -22,11 +26,17 @@ public class RootGridPane extends GridPane {
public void initComponents() { public void initComponents() {
btButton1 = new Button("Button1"); btButton1 = new Button("Button1");
btButton1.setPrefSize(200, 200); btButton1.setPrefSize(100, 100);
btButton1.setAlignment(Pos.BOTTOM_RIGHT);
btLaden = new Button("Laden-Button"); btLaden = new Button("Laden-Button");
btLaden.setPrefSize(200, 200); btLaden.setPrefSize(200, 200);
btLaden.setAlignment(Pos.TOP_CENTER);
btSpeichern = new Button("Speichern-Button"); btSpeichern = new Button("Speichern-Button");
btSpeichern.setPrefSize(200, 200); btSpeichern.setPrefSize(200, 200);
btSpeichern.setAlignment(Pos.BOTTOM_LEFT);
btButton4 = new Button("Button vier"); btButton4 = new Button("Button vier");
btButton5 = new Button("Button5"); btButton5 = new Button("Button5");
btButton6 = new Button("Button 6"); btButton6 = new Button("Button 6");
@ -34,7 +44,14 @@ public class RootGridPane extends GridPane {
btButtonAcht = new Button("Button acht"); btButtonAcht = new Button("Button acht");
fpRechtsUnten = new FlowPane(); fpRechtsUnten = new FlowPane();
fpRechtsUnten.setPrefSize(200, 200); fpRechtsUnten.setPrefSize(200, 200);
fpRechtsUnten.setAlignment(Pos.CENTER_LEFT);
fpRechtsUnten.setPadding(new Insets(10));
fpRechtsUnten.setHgap(10);
fpRechtsUnten.setVgap(10);
GridPane.setHalignment(btButton1, HPos.CENTER);
GridPane.setValignment(btButton1, VPos.BOTTOM);
} }
public void addComponents() { public void addComponents() {
@ -47,5 +64,4 @@ public class RootGridPane extends GridPane {
fpRechtsUnten.getChildren().addAll(btButton4, btButton5, btButton6, btButtonSieben, btButtonAcht); fpRechtsUnten.getChildren().addAll(btButton4, btButton5, btButton6, btButtonSieben, btButtonAcht);
} }
} }