import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class TextFieldUndoable extends Application{
	public static void main(String[] args) {
		launch(args);
	}
	public void start(Stage pStage) { 
		final BorderPane pane = new BorderPane(); 
		final Scene scene = new Scene(pane); 
		pStage.setScene(scene); 

		TextField tf = new TextField(); 

		pane.setCenter(tf); 
		System.out.println(tf.isUndoable());
		tf.undoableProperty().addListener((pObs, pOldVal, pNewVal) -> { 
			System.err.println("undoable property changed: " + tf.isUndoable()); 
			try { 
				throw new RuntimeException(); 
			} catch (Exception e) { 
				e.printStackTrace(); 
			}
		}); 

		pStage.show(); 
	} 
}
