/** defines what happens, before the GUI is started */ public void initialize(URL location, ResourceBundle resources) { // set the controller var in the Main class to this Controller Main.controller = this; updateList(); log.debug("List updated"); // Formatting of the listView listView.setFixedCellSize(60); listView.setItems(items); addButton.setSelected(true); log.debug("ListView cellSize changed, items assigned"); // is activated if the text in the searchbox is changed searchBox .textProperty() .addListener( (observable, oldVal, newVal) -> { renewSearch(newVal); }); // is called when the selected Search Radiobutton is changed searchToggle .selectedToggleProperty() .addListener( new ChangeListener<Toggle>() { public void changed( ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) { renewSearch(searchBox.getText()); } }); // gets called if an item in the listview is selected -> will load the // currently selected item // in the overview on the left listView .getSelectionModel() .getSelectedItems() .addListener( new ListChangeListener<ItemBox>() { @Override public void onChanged( javafx.collections.ListChangeListener.Change<? extends ItemBox> c) { // Update the overview section on the left side of the GUI updateOverview(); } }); setupMenuItems(); }