Redo « Text Input « Java Swing Q&A





2. Undo and Redo action in JFormattedTextField    forums.oracle.com

I have set the Maskformatter to the JFormattedTextField like below MaskFormatter maskFormatter = new MaskFormatter("***.***.***.***"); maskFormatter.setOverwriteMode(true); maskFormatter.setPlaceholderCharacter(' '); maskFormatter.setValidCharacters(" 0123456789"); JFormattedTextField formatText = new JFormattedTextField (maskFormatter); and i have added the undo and redo action to the JFormattedTextField. But it does not work properly. i.e. when we do the undo operation it takes two action ( two time CTRL + Z) ...