org.netbeans.editor.addChangeListener(myListener);

Source: NetBeans FAQ