Creating/opening .Java file

Answered
I was wondering if it's possible to create and open a .Java file in the IntelliJ IDE, from the source code in the IDE. I am wanting to prompt the user to put in a name of a file and would like to create the file and then open it in the IDE.
1 comment
Comment actions Permalink

You can use com.intellij.psi.JavaDirectoryService to create various top-level Java elements/files. https://jetbrains.org/intellij/sdk/docs/basics/architectural_overview/psi_files.html#how-do-i-create-a-psi-file offers generic way of creating (.java) file with any content.

0

Please sign in to leave a comment.