This is my fxml file and i made an eventlistener for my button with the id of "deletebutton":
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.VBox?>
<VBox minHeight="600.0" minWidth="800.0" spacing="20.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/20.0.1" fx:controller="com.example.carjava.HelloController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
</padding>
<children>
<Button fx:id="deleteButton" mnemonicParsing="false" text="Törlés" />
<TableView fx:id="carTable" prefHeight="500.0" prefWidth="200.0">
<columns>
<TableColumn fx:id="licensePlateCol" prefWidth="180.0" text="Rendszám" />
<TableColumn fx:id="modelCol" minWidth="0.0" prefWidth="180.0" text="Model" />
<TableColumn fx:id="brandCol" prefWidth="180.0" text="Márka" />
<TableColumn fx:id="dailyCostCol" prefWidth="180.0" text="Napidíj (Ft)" />
</columns>
</TableView>
</children>
</VBox>
I tried making an event listener but i was hoping for something simpler. And also is there a way of making a GUI faster and simpler?