0
How to get text from FXML file?
field of the FXML file:
<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();
}
}