@Override
  public void initialize() {
    disputesTable = new TableView<>();
    VBox.setVgrow(disputesTable, Priority.SOMETIMES);
    disputesTable.setMinHeight(150);
    root.getChildren().add(disputesTable);

    TableColumn<Dispute, Dispute> tradeIdColumn = getTradeIdColumn();
    disputesTable.getColumns().add(tradeIdColumn);
    TableColumn<Dispute, Dispute> roleColumn = getRoleColumn();
    disputesTable.getColumns().add(roleColumn);
    TableColumn<Dispute, Dispute> dateColumn = getDateColumn();
    disputesTable.getColumns().add(dateColumn);
    TableColumn<Dispute, Dispute> contractColumn = getContractColumn();
    disputesTable.getColumns().add(contractColumn);
    TableColumn<Dispute, Dispute> stateColumn = getStateColumn();
    disputesTable.getColumns().add(stateColumn);

    disputesTable.getSortOrder().add(dateColumn);
    disputesTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    Label placeholder = new Label("There are no open tickets");
    placeholder.setWrapText(true);
    disputesTable.setPlaceholder(placeholder);
    disputesTable.getSelectionModel().clearSelection();

    disputeChangeListener = (observableValue, oldValue, newValue) -> onSelectDispute(newValue);
  }
  @Override
  protected void activate() {
    FilteredList<Dispute> filteredList =
        new FilteredList<>(disputeManager.getDisputesAsObservableList());
    setFilteredListPredicate(filteredList);
    SortedList<Dispute> sortedList = new SortedList<>(filteredList);
    sortedList.setComparator((o1, o2) -> o2.getOpeningDate().compareTo(o1.getOpeningDate()));
    disputesTable.setItems(sortedList);
    disputesTable.getSelectionModel().selectedItemProperty().addListener(disputeChangeListener);

    Dispute selectedItem = disputesTable.getSelectionModel().getSelectedItem();
    if (selectedItem != null) disputesTable.getSelectionModel().select(selectedItem);

    scrollToBottom();
  }
  /**
   * Erzeugt eine TableView mit den Daten aus der Datenbank.
   *
   * @return Eine TableView mit Polizist Daten
   */
  private Node getPolizistAnsichtInnereTabelle() {
    refreshPolizistAnsicht();

    // Name Spalte
    TableColumn<PolizistDaten, String> SpalteName = new TableColumn<>("Name");
    SpalteName.setMinWidth(200);
    SpalteName.setCellValueFactory(new PropertyValueFactory<>("Name"));

    // GebDatum Spalte
    TableColumn<PolizistDaten, String> SpalteDatum = new TableColumn<>("Geburtsdatum");
    SpalteDatum.setMinWidth(200);
    SpalteDatum.setCellValueFactory(new PropertyValueFactory<>("GebDatum"));

    // Nationalitaet Spalte
    TableColumn<PolizistDaten, String> SpalteNation = new TableColumn<>("Nationalität");
    SpalteNation.setMinWidth(200);
    SpalteNation.setCellValueFactory(new PropertyValueFactory<>("Nation"));

    // Geschlecht Spalte
    TableColumn<PolizistDaten, String> SpalteGeschlecht = new TableColumn<>("Geschlecht");
    SpalteGeschlecht.setMinWidth(200);
    SpalteGeschlecht.setCellValueFactory(new PropertyValueFactory<>("Geschlecht"));

    // Todesdatum Spalte
    TableColumn<PolizistDaten, String> SpalteTod = new TableColumn<>("Todesdatum");
    SpalteTod.setMinWidth(200);
    SpalteTod.setCellValueFactory(new PropertyValueFactory<>("TodDatum"));

    // Dienstgrad Spalte
    TableColumn<PolizistDaten, String> SpalteGrad = new TableColumn<>("Dienstgrad");
    SpalteGrad.setMinWidth(200);
    SpalteGrad.setCellValueFactory(new PropertyValueFactory<>("Dienstgrad"));

    Tabelle.setItems(PolizistDatenListe);
    Tabelle.getColumns().add(SpalteName);
    Tabelle.getColumns().add(SpalteDatum);
    Tabelle.getColumns().add(SpalteNation);
    Tabelle.getColumns().add(SpalteGeschlecht);
    Tabelle.getColumns().add(SpalteTod);
    Tabelle.getColumns().add(SpalteGrad);

    Tabelle.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

    // Doppelklicke auf Spalten sollen Detailansichten oeffnen:
    Tabelle.setRowFactory(
        param -> {
          TableRow<PolizistDaten> Spalte = new TableRow<>();
          Spalte.setOnMouseClicked(
              event -> {
                if (event.getClickCount() == 2 && (!Spalte.isEmpty())) {
                  erzeugeDetailAnsicht(Spalte.getItem());
                }
              });
          return Spalte;
        });

    return Tabelle;
  }
  private void deleteSelectedEntrys() {
    ObservableList<PolizistDaten> Nutzerauswahl = Tabelle.getSelectionModel().getSelectedItems();
    if (Nutzerauswahl.isEmpty()) {
      IM.setErrorText("Es muss mindestens ein Eintrag ausgewählt sein");
      return;
    }

    Nutzerauswahl.forEach(
        PolizistDaten -> {
          try {
            DH.getAnfrageObjekt()
                .executeUpdate(
                    "DELETE FROM POLIZIST WHERE PersonenID = " + PolizistDaten.getPersonenID());
          } catch (SQLException e) {
            IM.setErrorText("Löschen fehlgeschlagen", e);
          }
        });
    refreshPolizistAnsicht();
  }
 @Override
 protected void deactivate() {
   disputesTable.getSelectionModel().selectedItemProperty().removeListener(disputeChangeListener);
 }
Exemple #6
0
  @Override
  public void start(Stage primaryStage) throws Exception {
    /* create the menu (for the top of the user interface) */
    Menu fileMenu = new Menu("File");
    MenuItem newMenuItem = new MenuItem("New", imageFile("images/new.png"));
    newMenuItem.setAccelerator(KeyCombination.keyCombination("Ctrl+N"));
    fileMenu.getItems().add(newMenuItem);
    fileMenu.getItems().add(new SeparatorMenuItem());
    fileMenu.getItems().add(new MenuItem("Open...", imageFile("images/open.png")));
    fileMenu.getItems().add(new SeparatorMenuItem());
    MenuItem saveMenuItem = new MenuItem("Save", imageFile("images/save.png"));
    fileMenu.getItems().add(saveMenuItem);
    MenuItem saveAsMenuItem = new MenuItem("Save As...", imageFile("images/save_as.png"));
    fileMenu.getItems().add(saveAsMenuItem);
    fileMenu.getItems().add(new SeparatorMenuItem());
    MenuItem exitMenuItem = new MenuItem("Exit", imageFile("images/exit.png"));
    fileMenu.getItems().add(exitMenuItem);
    exitMenuItem.setAccelerator(KeyCombination.keyCombination("Ctrl+Q"));
    exitMenuItem.setOnAction(e -> System.exit(0));

    Menu editMenu = new Menu("Edit");
    editMenu.getItems().add(new MenuItem("Cut", imageFile("images/cut.png")));
    editMenu.getItems().add(new MenuItem("Copy", imageFile("images/copy.png")));
    editMenu.getItems().add(new MenuItem("Paste", imageFile("images/paste.png")));

    Menu helpMenu = new Menu("Help");
    helpMenu.getItems().add(new MenuItem("About...", imageFile("images/about.png")));
    helpMenu.getItems().add(new SeparatorMenuItem());
    helpMenu.getItems().add(new MenuItem("Help...", imageFile("images/help.png")));

    MenuBar menuBar = new MenuBar();
    menuBar.getMenus().add(fileMenu);
    menuBar.getMenus().add(editMenu);
    menuBar.getMenus().add(helpMenu);
    primaryStage.setTitle("Lab08");
    // grid contains all of the textfeilds, labels , buttons, ect..
    GridPane grid = new GridPane();
    // the tableview puts all of our data into a exel like format
    TableView<StudentRecord> table = new TableView<>();
    table.setItems(DataSource.getAllMarks());
    table.setEditable(true);

    TableColumn<StudentRecord, String> IDColumn = null;
    IDColumn = new TableColumn<>("SID");
    IDColumn.setMinWidth(100);
    // the thing in quotes is what it will search for in the StudentRecords.java (MAKE SURE THERE IS
    // A GET FUNCTION FOR THAT VARIBALE)
    IDColumn.setCellValueFactory(new PropertyValueFactory<>("ID"));

    TableColumn<StudentRecord, Double> AssignmentColumn = null;
    AssignmentColumn = new TableColumn<>("Assignment");
    AssignmentColumn.setMinWidth(100);
    AssignmentColumn.setCellValueFactory(new PropertyValueFactory<>("Assign"));

    TableColumn<StudentRecord, Float> MidtermColumn = null;
    MidtermColumn = new TableColumn<>("Midterm");
    MidtermColumn.setMinWidth(100);
    MidtermColumn.setCellValueFactory(new PropertyValueFactory<>("Midterm"));

    TableColumn<StudentRecord, Float> FinalColumn = null;
    FinalColumn = new TableColumn<>("Final Exam");
    FinalColumn.setMinWidth(100);
    FinalColumn.setCellValueFactory(new PropertyValueFactory<>("Final"));

    TableColumn<StudentRecord, String> GradeColumn = null;
    GradeColumn = new TableColumn<>("Letter Grade");
    GradeColumn.setMinWidth(100);
    GradeColumn.setCellValueFactory(new PropertyValueFactory<>("Grade"));

    table.getColumns().add(IDColumn);
    table.getColumns().add(AssignmentColumn);
    table.getColumns().add(MidtermColumn);
    table.getColumns().add(FinalColumn);
    table.getColumns().add(GradeColumn);

    Label IDLabel = new Label("SID:");
    grid.add(IDLabel, 0, 0);
    TextField IDField = new TextField();
    IDField.setPromptText("SID");
    grid.add(IDField, 1, 0);

    Label AssignLabel = new Label("Assignments:");
    grid.add(AssignLabel, 2, 0);

    TextField AssignField = new TextField();
    AssignField.setPromptText("Assignment");
    grid.add(AssignField, 3, 0);

    Label MidLabel = new Label("Midterm:");
    grid.add(MidLabel, 0, 1);

    TextField midField = new TextField();
    midField.setPromptText("Midterm");
    grid.add(midField, 1, 1);

    Label FinalLabel = new Label("Final:");
    grid.add(FinalLabel, 2, 1);

    TextField FinalField = new TextField();
    FinalField.setPromptText("Final");
    grid.add(FinalField, 3, 1);

    Button AddButton = new Button("Add");
    AddButton.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            char Grade;
            String SID = IDField.getText();
            Float Assignment = Float.parseFloat(AssignField.getText());
            Float Midterm = Float.parseFloat(midField.getText());
            Float Final = Float.parseFloat(FinalField.getText());
            table.getItems().add(new StudentRecord(SID, Assignment, Midterm, Final));

            IDField.setText("");
            AssignField.setText("");
            midField.setText("");
            FinalField.setText("");
          }
        });
    grid.add(AddButton, 0, 2);

    layout = new BorderPane();
    layout.setTop(menuBar);
    layout.setCenter(table);
    layout.setBottom(grid);

    Scene scene = new Scene(layout);
    grid.setPadding(new Insets(10, 10, 10, 10));
    grid.setVgap(10);
    grid.setHgap(10);

    primaryStage.setScene(scene);
    primaryStage.show();
  }
  @Override
  public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("JavaFX Demo");

    /* create the menu (for the top of the user interface) */
    Menu fileMenu = new Menu("File");
    MenuItem newMenuItem = new MenuItem("New", imageFile("images/new.png"));
    newMenuItem.setAccelerator(KeyCombination.keyCombination("Ctrl+N"));
    fileMenu.getItems().add(newMenuItem);
    fileMenu.getItems().add(new SeparatorMenuItem());
    fileMenu.getItems().add(new MenuItem("Open...", imageFile("images/open.png")));
    fileMenu.getItems().add(new SeparatorMenuItem());
    fileMenu.getItems().add(new MenuItem("Save", imageFile("images/save.png")));
    fileMenu.getItems().add(new MenuItem("Save As...", imageFile("images/save_as.png")));
    fileMenu.getItems().add(new SeparatorMenuItem());
    MenuItem exitMenuItem = new MenuItem("Exit", imageFile("images/exit.png"));
    fileMenu.getItems().add(exitMenuItem);
    exitMenuItem.setAccelerator(KeyCombination.keyCombination("Ctrl+Q"));
    exitMenuItem.setOnAction(e -> System.exit(0));

    Menu editMenu = new Menu("Edit");
    editMenu.getItems().add(new MenuItem("Cut", imageFile("images/cut.png")));
    editMenu.getItems().add(new MenuItem("Copy", imageFile("images/copy.png")));
    editMenu.getItems().add(new MenuItem("Paste", imageFile("images/paste.png")));

    Menu helpMenu = new Menu("Help");
    helpMenu.getItems().add(new MenuItem("About...", imageFile("images/about.png")));
    helpMenu.getItems().add(new SeparatorMenuItem());
    helpMenu.getItems().add(new MenuItem("Help...", imageFile("images/help.png")));

    MenuBar menuBar = new MenuBar();
    menuBar.getMenus().add(fileMenu);
    menuBar.getMenus().add(editMenu);
    menuBar.getMenus().add(helpMenu);

    /* create the table (for the center of the user interface) */
    table = new TableView<>();
    table.setItems(DataSource.getAllStudents());
    table.setEditable(true);

    /* create the table's columns */
    TableColumn<Student, Integer> sidColumn = null;
    sidColumn = new TableColumn<>("SID");
    sidColumn.setMinWidth(100);
    sidColumn.setCellValueFactory(new PropertyValueFactory<>("sid"));

    TableColumn<Student, String> firstNameColumn = null;
    firstNameColumn = new TableColumn<>("First Name");
    firstNameColumn.setMinWidth(200);
    firstNameColumn.setCellValueFactory(new PropertyValueFactory<>("firstName"));
    firstNameColumn.setCellFactory(TextFieldTableCell.<Student>forTableColumn());
    firstNameColumn.setOnEditCommit(
        (CellEditEvent<Student, String> event) -> {
          ((Student) event.getTableView().getItems().get(event.getTablePosition().getRow()))
              .setFirstName(event.getNewValue());
        });

    TableColumn<Student, String> lastNameColumn = null;
    lastNameColumn = new TableColumn<>("Last Name");
    lastNameColumn.setMinWidth(200);
    lastNameColumn.setCellValueFactory(new PropertyValueFactory<>("lastName"));
    lastNameColumn.setCellFactory(TextFieldTableCell.<Student>forTableColumn());
    lastNameColumn.setOnEditCommit(
        (CellEditEvent<Student, String> event) -> {
          ((Student) event.getTableView().getItems().get(event.getTablePosition().getRow()))
              .setLastName(event.getNewValue());
        });

    TableColumn<Student, Double> gpaColumn = null;
    gpaColumn = new TableColumn<>("GPA");
    gpaColumn.setMinWidth(100);
    gpaColumn.setCellValueFactory(new PropertyValueFactory<>("gpa"));

    table.getColumns().add(sidColumn);
    table.getColumns().add(lastNameColumn);
    table.getColumns().add(firstNameColumn);
    table.getColumns().add(gpaColumn);

    /* create an edit form (for the bottom of the user interface) */
    GridPane editArea = new GridPane();
    editArea.setPadding(new Insets(10, 10, 10, 10));
    editArea.setVgap(10);
    editArea.setHgap(10);

    Label sidLabel = new Label("SID:");
    editArea.add(sidLabel, 0, 0);
    TextField sidField = new TextField();
    sidField.setPromptText("SID");
    editArea.add(sidField, 1, 0);

    Label fnameLabel = new Label("First name:");
    editArea.add(fnameLabel, 0, 1);
    TextField fnameField = new TextField();
    fnameField.setPromptText("First Name");
    editArea.add(fnameField, 1, 1);

    Label lnameLabel = new Label("Last name:");
    editArea.add(lnameLabel, 0, 2);
    TextField lnameField = new TextField();
    lnameField.setPromptText("Last Name");
    editArea.add(lnameField, 1, 2);

    Label gpaLabel = new Label("GPA:");
    editArea.add(gpaLabel, 0, 3);
    TextField gpaField = new TextField();
    gpaField.setPromptText("GPA");
    editArea.add(gpaField, 1, 3);

    Button addButton = new Button("Add");
    addButton.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            int sid = Integer.parseInt(sidField.getText());
            String firstName = fnameField.getText();
            String lastName = lnameField.getText();
            double gpa = Double.parseDouble(gpaField.getText());

            table.getItems().add(new Student(sid, firstName, lastName, gpa));

            sidField.setText("");
            fnameField.setText("");
            lnameField.setText("");
            gpaField.setText("");
          }
        });
    editArea.add(addButton, 1, 4);

    /* arrange all components in the main user interface */
    layout = new BorderPane();
    layout.setTop(menuBar);
    layout.setCenter(table);
    layout.setBottom(editArea);

    Scene scene = new Scene(layout, 600, 600);
    primaryStage.setScene(scene);
    primaryStage.show();
  }
  private void updateSelectedEntry() {
    ObservableList<PolizistDaten> Nutzerauswahl = Tabelle.getSelectionModel().getSelectedItems();
    if (Nutzerauswahl.size() != 1) {
      IM.setErrorText("Es muss genau ein Element ausgewählt werden");
      return;
    }
    PolizistDaten Auswahl = Nutzerauswahl.get(0);

    // Jetzt erzeugen wir ein PopUp zum veraendern des Eintrags

    Stage PopUp = new Stage();
    PopUp.initModality(Modality.APPLICATION_MODAL);
    PopUp.setTitle("Neuer Eintrag");
    PopUp.setAlwaysOnTop(true);
    PopUp.setResizable(false);

    GridPane Gitter = new GridPane();
    Gitter.setHgap(10);
    Gitter.setVgap(10);

    Label LabelA = new Label("PersonenID");
    Label LabelAWert = new Label(Integer.toString(Auswahl.getPersonenID()));

    Label LabelB = new Label("Name");
    TextField LabelBWert = new TextField();

    Label LabelC = new Label("Geburtsdatum");
    DatePicker LabelCWert = new DatePicker();

    Label LabelD = new Label("Nationalität");
    TextField LabelDWert = new TextField();

    Label LabelE = new Label("Geschlecht");
    ComboBox LabelEWert = new ComboBox();

    Label LabelF = new Label("Todesdatum");
    DatePicker LabelFWert = new DatePicker();

    Label LabelG = new Label("Dienstgrad");
    TextField LabelGWert = new TextField();

    final Callback<DatePicker, DateCell> TagesZellenFabtrik =
        new Callback<DatePicker, DateCell>() {
          @Override
          public DateCell call(final DatePicker DP) {
            return new DateCell() {
              @Override
              public void updateItem(LocalDate item, boolean empty) {
                super.updateItem(item, empty);

                if (item.isBefore(LabelCWert.getValue().plusDays(1))) {
                  setDisable(true);
                  setStyle("-fx-background-color: #ffc0cb;");
                }
              }
            };
          }
        };
    LabelFWert.setDayCellFactory(TagesZellenFabtrik);

    LabelEWert.getItems().addAll("m", "w");
    LabelEWert.setValue(Auswahl.getGeschlecht());

    LabelBWert.setText(Auswahl.getName());
    LabelCWert.setValue(LocalDate.parse(Auswahl.getGebDatum())); // TODO exception
    LabelDWert.setText(Auswahl.getNation());
    if (!Auswahl.getTodDatum().isEmpty()) {
      LabelFWert.setValue(LocalDate.parse(Auswahl.getTodDatum())); // TODO exception
    }
    LabelGWert.setText(Auswahl.getDienstgrad());

    Button ButtonFort = new Button("Fortfahren");
    Button ButtonAbb = new Button("Abbrechen");

    ButtonFort.defaultButtonProperty();
    ButtonAbb.cancelButtonProperty();

    ButtonFort.setMaxWidth(Double.MAX_VALUE);
    ButtonAbb.setMaxWidth(Double.MAX_VALUE);

    Gitter.addColumn(0, LabelA, LabelB, LabelC, LabelD, LabelE, LabelF, LabelG);
    Gitter.addColumn(
        1, LabelAWert, LabelBWert, LabelCWert, LabelDWert, LabelEWert, LabelFWert, LabelGWert);

    VBox AussenBox = new VBox(10);
    HBox InnenBox = new HBox();

    AussenBox.setSpacing(10);
    AussenBox.setPadding(new Insets(10));
    InnenBox.setSpacing(10);

    AussenBox.setAlignment(Pos.CENTER);
    InnenBox.setAlignment(Pos.BOTTOM_CENTER);

    AussenBox.getChildren().addAll(Gitter, InnenBox);
    InnenBox.getChildren().addAll(ButtonFort, ButtonAbb);

    ButtonAbb.setOnAction(event -> PopUp.close());
    ButtonFort.setOnAction(
        event -> {
          String SQLString;
          if (LabelFWert.getEditor().getText().isEmpty()) {
            SQLString =
                "UPDATE PERSON SET Name=?, Geburtsdatum=?, Nationalität=?, Geschlecht=?, Todesdatum=NULL WHERE PersonenID = "
                    + Auswahl.getPersonenID();
          } else {
            SQLString =
                "UPDATE PERSON SET Name=?, Geburtsdatum=?, Nationalität=?, Geschlecht=?, Todesdatum=? WHERE PersonenID = "
                    + Auswahl.getPersonenID();
          }
          try {
            PreparedStatement InsertStatement = DH.prepareStatement(SQLString);
            InsertStatement.setString(1, LabelBWert.getText());
            InsertStatement.setString(2, LabelCWert.getValue().toString()); // TODO exception
            InsertStatement.setString(3, LabelDWert.getText());
            InsertStatement.setString(4, LabelEWert.getValue().toString());
            if (LabelFWert.getValue() != null && !LabelFWert.getEditor().getText().isEmpty()) {
              InsertStatement.setString(5, LabelFWert.getValue().toString());
            }
            InsertStatement.executeUpdate();
            SQLString =
                "UPDATE POLIZIST SET Dienstgrad = ? WHERE PersonenID = " + Auswahl.getPersonenID();
            InsertStatement = DH.prepareStatement(SQLString);
            InsertStatement.setString(1, LabelGWert.getText());
            InsertStatement.execute();
            IM.setInfoText("Änderung durchgeführt");
          } catch (SQLException e) {
            IM.setErrorText("Ändern Fehlgeschlagen", e);
          }
          refreshPolizistAnsicht();
          PopUp.close();
        });

    PopUp.setScene(new Scene(AussenBox));
    PopUp.showAndWait();
  }
  private void erzeugeDetailAnsicht(PolizistDaten SpaltenDaten) {
    Label LabelA = new Label("PersonenID");
    Label LabelAWert = new Label(Integer.toString(SpaltenDaten.getPersonenID()));

    Label LabelB = new Label("Name");
    Label LabelBWert = new Label(SpaltenDaten.getName());

    Label LabelC = new Label("Geburtsdatum");
    Label LabelCWert = new Label(SpaltenDaten.getGebDatum());

    Label LabelD = new Label("Nationalität");
    Label LabelDWert = new Label(SpaltenDaten.getNation());

    Label LabelE = new Label("Geschlecht");
    Label LabelEWert = new Label(SpaltenDaten.getGeschlecht());

    Label LabelF = new Label("Todesdatum");
    Label LabelFWert = new Label(SpaltenDaten.getTodDatum());

    Label LabelG = new Label("Dienstgrad");
    Label LabelGWert = new Label(SpaltenDaten.getDienstgrad());

    Button ButtonBearbeiten = new Button("Bearbeiten...");
    Button ButtonLoeschen = new Button("Löschen");

    Button ButtonSuchePerson = new Button("Suche nach Person");
    Button ButtonSucheArbeit = new Button("Suche nach Arbeitsverhältnissen");
    Button ButtonSucheArbeitAn = new Button("Suche nach zugewiesenen Fällen");
    Button ButtonSucheNotizen = new Button("Suche nach erstellten Notizen");
    Button ButtonSucheIndizien = new Button("Suche nach eingestellten Indizien");

    Button ButtonClose = new Button("Detailansicht verlassen");

    ButtonBearbeiten.setOnAction(
        event -> {
          Tabelle.getSelectionModel().clearSelection();
          Tabelle.getSelectionModel().select(SpaltenDaten);
          updateSelectedEntry();
          Hauptprogramm.setRechteAnsicht(null);
        });
    ButtonLoeschen.setOnAction(
        event -> {
          Tabelle.getSelectionModel().clearSelection();
          Tabelle.getSelectionModel().select(SpaltenDaten);
          deleteSelectedEntrys();
          Hauptprogramm.setRechteAnsicht(null);
        });

    ButtonSuchePerson.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          PersonenAM.PersonenSuchAnsicht(SpaltenDaten.getPersonenID());
        });
    ButtonSucheArbeit.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          ArbeitenAM.SucheNachPersonenID(SpaltenDaten.getPersonenID());
        });
    ButtonSucheArbeitAn.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          ArbeitenAnAM.SucheNachPersonenID(SpaltenDaten.getPersonenID());
        });
    ButtonSucheNotizen.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          NotizAM.SucheNachAnlegendem(SpaltenDaten.getPersonenID());
        });
    ButtonSucheIndizien.setOnAction(
        event -> {
          Hauptprogramm.setRechteAnsicht(null);
          IndizAM.SucheNachAnlegendem(SpaltenDaten.getPersonenID());
        });

    ButtonClose.setOnAction(event -> Hauptprogramm.setRechteAnsicht(null));

    ButtonBearbeiten.setMaxWidth(Double.MAX_VALUE);
    ButtonBearbeiten.setMinWidth(150);
    ButtonLoeschen.setMaxWidth(Double.MAX_VALUE);
    ButtonLoeschen.setMinWidth(150);
    ButtonSuchePerson.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheArbeit.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheArbeitAn.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheNotizen.setMaxWidth(Double.MAX_VALUE);
    ButtonSucheIndizien.setMaxWidth(Double.MAX_VALUE);
    ButtonClose.setMaxWidth(Double.MAX_VALUE);

    // Wir haben ein Gridpane oben, eine HBox unten in einer VBox in einem ScrollPane
    GridPane Oben = new GridPane();
    Oben.setHgap(10);
    Oben.setVgap(10);
    Oben.addColumn(0, LabelA, LabelB, LabelC, LabelD, LabelE, LabelF, LabelG);
    Oben.addColumn(
        1, LabelAWert, LabelBWert, LabelCWert, LabelDWert, LabelEWert, LabelFWert, LabelGWert);
    Oben.getColumnConstraints().add(new ColumnConstraints(100));
    Oben.getColumnConstraints().add(new ColumnConstraints(200));

    HBox Unten = new HBox(10);
    Unten.getChildren().addAll(ButtonBearbeiten, ButtonLoeschen);
    Unten.setMaxWidth(300);
    Unten.alignmentProperty().setValue(Pos.CENTER);

    VBox Mittelteil = new VBox(10);
    Mittelteil.setPadding(new Insets(10, 20, 10, 10));
    Mittelteil.getChildren()
        .addAll(
            Oben,
            Unten,
            ButtonSuchePerson,
            ButtonSucheArbeit,
            ButtonSucheArbeitAn,
            ButtonSucheNotizen,
            ButtonSucheIndizien,
            ButtonClose);

    ScrollPane Aussen = new ScrollPane();

    Aussen.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    Aussen.setContent(Mittelteil);

    Hauptprogramm.setRechteAnsicht(Aussen);
  }