How do I get text from the FXML file?
FXML file field:
<TextField fx:id="usernameSU" GridPane.columnIndex="1" />
Controller file:
public class signUpController implements Initializable {
@FXML private TextField usernameSU;
@FXML
private void signUp(ActionEvent event) {
System.out.println(""); //Imprimir TextField para teste
}
@Override
public void initialize(URL url, ResourceBundle rb) {
usernameSU = new TextField();
}
}