Supossing that a JFormattedTextField is enabled and contains a formatter, is there a way to make it readonly? With a JTextField, we just need to suply a custom
What about undoing every change that occurs:
JFormattedTextField formattedTextField = new JFormattedTextField("Can't touch this! :)");
formattedTextField.getDocument().addUndoableEditListener(new UndoableEditListener() {
@Override
public void undoableEditHappened(UndoableEditEvent e) {
e.getEdit().undo();
}
});