Print
JTextComponent ed = org.netbeans.editor.getMostActiveComponent();

Source: NetBeans FAQ

Parent Category: Other API Tips