You can put an event action on the text box that calls a nanoflow.
In this nanoflow the input of your text box will be a parameter and you can pass it to your Java Action (via a microflow?)
A textbox widget is always connected to an attribute, part of an object. A textbox widget must always be placed in a dataview or listview which is connected to the context entity.
In my example Festival is the context object and Name the string attribute.
You can pass the context object into the microflow, and use the attribute values from the object variable.
in below example the Festival object enters the Nanoflow and I can access the Name attribute by using $Festival/Name