I'm trying to change the text of a textfield being handled by another class.
public String updateAddress() {
webEngine.getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) -> {
if (Worker.State.SUCCEEDED.equals(newValue)) {
Client.addressBar.setText(webEngine.getLocation());
}
});
return null;
}
but this only works if the textfield is static.
When I try to create a method that updates the textfield Java just crashes. I'm trying to create a multi tabbed browser so this method would update the address bar when the current tab I'm on is selected.