im trying to add some text to a textfield, but when i click the button nothing happens , why is this happening?
MainWindowController.java
@FXML
public static TextField konsumatoriPunetField = new TextField();
@FXML
private void initialize()
{
FXMLLoader loader5 = new FXMLLoader();
loader5.setLocation(getClass().getResource("ZgjedhKonsumatorinFXML.fxml"));
BorderPane border5 = new BorderPane();
border5 = loader5.load();
Scene scene5 = new Scene(border5);
zgjedhkonsumatorinstage.setScene(scene5);
zgjedhkonsumatorinstage.setTitle("Pit Stop");
zgjedhkonsumatorinstage.initModality(Modality.WINDOW_MODAL);
zgjedhkonsumatorinstage.initOwner(MainFXMLController.mainFXMLStage);
}
@FXML
public void zgjedhKonsumatorin()
{
zgjedhkonsumatorinstage.showAndWait();
}
MainWindowFXML.fxml
<TextField fx:id="konsumatoriPunetField" editable="false" onMouseClicked="#zgjedhKonsumatorin" promptText="Kliko per te zgjedhur" GridPane.columnIndex="1" GridPane.rowIndex="1" />
ZgjedhKonsumatorinController.java
@FXML
public void zgjedhKonsumatorin()
{
MainWindowController.zgjedhkonsumatorinstage.close();
MainWindowController.konsumatoriPunetField.setText("ertani");
}
ZgjedhKonsumatorinFXML.fxml
<Button mnemonicParsing="false" onAction="#zgjedhKonsumatorin" prefWidth="150.0" text="Zgjedh Konsumatorin" />