Hi I am with scenebuilder I want to store on mouse click the selected textarea inside a variable which I can then use with a button to clear content of the selected textarea.

Here is


I have tried everything but I cannot seem to find a way to get the id of one of my textareas and store it so my clear button method can then set the text in it to nothing.


Here is my controller code

Help would be amazing thank you!

Code:
package sample;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;

import java.awt.event.MouseEvent;


public class TextEdit {

    @FXML
    private Button clearButton;

    @FXML
    private TextArea inputxt;

    @FXML
    private TextArea outputTxt;

    @FXML
    private TextArea FindTxt;

    @FXML
    private TextArea ReplaceTxt;


    private String CurrentlySelectedTextBox;



    @FXML
    private void SetCurrentlySelectedTextBox(MouseEvent event) {
        TextArea boxid = (TextArea) event.getSource();
        System.out.println("Entered: " + boxid.getId());
    }





    @FXML
    void cleartxt() {


        inputxt.setText("");

    }


}