You can add the built-in Java code completion from the Netbeans 6 Java editor to any arbitrary JEditorPane See the code below for how this can be achieved Note that Netbeans Java editor functionality is derived from an underlying FileObject  so we are essentially creating a dummy Java FileObject and tying our JEditorPane document in with the appropriate hooks