2 comments
Comment actions Permalink

You can not use JTextPane but you can create a proper editor component instead.


PsiFile file = PsiFileFactory.getInstance(project).createFileFromText(...) - create a file

Document document = PsiDocumentManager.getInstance(project).getDocument(file) - get the document

Editor editor = EditorFactory.getInstance().createEditor(document, project) - create an editor for your document



Use editor.getComponent() to render you text editor (in place of your JTextPane)

0

Please sign in to leave a comment.