JEditor to listen to the modifications of the underlying document by JEditor.addEditorStateListener(EditorStateListener):JEditor is first setJEditor editor = new JEditor(); editor.setText(<the text>); editor.addEditorStateListener(new EditorStateListener() { public void documentStateChanged(short state) { if (state == EditorStateListener.STATE_SAVED) { try { editor.saveAs(file); } catch (IOException ex) { } } } });
Copyright 2016-2019 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence