Hello. Such a problem:
there is an fxml file with this code
<TextField fx:id="txtField" alignment="TOP_LEFT" onAction="#getNumberFromTF" prefHeight="25.0" prefWidth="54.0" /> and accordingly the controller of the following content: @FXML private TextField txtField;
@FXML private void getNumberFromTF() { try { txtField.addActionListener((ae) -> MainApp.numberPage = Integer.parseInt(txtField.getText())); }catch (NumberFormatException e){ System.out.println(e); } } Why is fx: id highlighted in red in the fxml file? Hovering over fx: id with the cursor, IDEA shows the message: "Cannot set javafx.scene.control.TextField to field 'txtField'"