Apache NetBeans
Apache NetBeans
Latest release

Apache NetBeans 23

Download

How can I find the currently open document in the selected editor?

JTextComponent ed = org.netbeans.api.editor.EditorRegistry.lastFocusedComponent();
Document doc = ed.getDocument();