import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

public class Invalidation extends Application {

	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage stage) {

		 TextField tf = new TextField();
	        HBox box = new HBox(5, new Label("Enter Text: "), tf);

	        tf.textProperty().addListener(obs -> System.out.println("invalid"));

	        stage.setScene(new Scene(box, 300, 80));
	        stage.setTitle("Example 2: TextField Property Listener");
	        stage.show();
	}

}