Formatting

This commit is contained in:
FUH22860 2022-05-03 11:58:24 +02:00
parent c8707d7198
commit 9cf215f5d0
2 changed files with 19 additions and 28 deletions

View File

@ -5,28 +5,21 @@ import javafx.stage.Stage;
import javafx.scene.Scene;
//import javafx.scene.layout.BorderPane;
public class Main extends Application
{
public void start(Stage primaryStage)
{
try
{
public class Main extends Application {
public void start(Stage primaryStage) {
try {
RootGridPane root = new RootGridPane();
// BorderPane root = new BorderPane();
Scene scene = new Scene(root, 400, 400);
primaryStage.setScene(scene);
primaryStage.setTitle("Erstes Fenster");
primaryStage.show();
}
catch (Exception e)
{
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args)
{
public static void main(String[] args) {
launch(args);
}
}
}

View File

@ -4,19 +4,17 @@ import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
public class RootGridPane extends GridPane {
// Button btButton1;
// Button btLaden;
// Button btSpeichern;
Button btButton1, btLaden, btSpeichern;
Button btButton4, btButton5, btButton6, btButtonSieben, btButtonAcht;
FlowPane fpRechtsUnten ;
public RootGridPane()
{
FlowPane fpRechtsUnten;
public RootGridPane() {
initComponents();
addComponents();
}
@ -24,19 +22,19 @@ public class RootGridPane extends GridPane {
public void initComponents() {
btButton1 = new Button("Button1");
btButton1.setPrefSize(200, 200);
btButton1.setPrefSize(200, 200);
btLaden = new Button("Laden-Button");
btLaden.setPrefSize(200, 200);
btLaden.setPrefSize(200, 200);
btSpeichern = new Button("Speichern-Button");
btSpeichern.setPrefSize(200, 200);
btSpeichern.setPrefSize(200, 200);
btButton4 = new Button("Button vier");
btButton5 = new Button("Button5");
btButton6 = new Button("Button 6");
btButtonSieben = new Button("Button sieben");
btButtonAcht = new Button("Button acht");
fpRechtsUnten = new FlowPane();
fpRechtsUnten.setPrefSize(200, 200);
fpRechtsUnten = new FlowPane();
fpRechtsUnten.setPrefSize(200, 200);
}
public void addComponents() {
@ -45,9 +43,9 @@ public class RootGridPane extends GridPane {
add(btLaden, 1, 0);
add(btSpeichern, 0, 1);
add(fpRechtsUnten, 1, 1);
fpRechtsUnten.getChildren().addAll(btButton4, btButton5, btButton6, btButtonSieben, btButtonAcht);
}
}