Is it possible to export a GUI form so it can be run in any IDE?

Answered

I'm trying to create a pretty simple GUI, and IntelliJ has seemed to have the best free GUI creater that I could find. I have spent countless hours trying to figure out how I could save or export the files to be able to use them in another IDE. I'm doing this for school projects, so they need to be able to run on a clean build of Eclipse when my professor grades it. Am I going to have to continue using WindowBuilder/manually configuring the GUI for that to happen?

10 comments
Comment actions Permalink

In GUI Designer settings you can configure IDEA to generate GUI code into source .java files instead of the .class files. Then just include forms_rt.jar in the classpath and your project will compile and run from any IDE.

0
Comment actions Permalink

I have found where to change from binary class files to Java source code, but I'm not sure where to find forms_rt.jar. Also, upon changing to the Java source code option, the $$$setupUI$$$() that was created has multiple "cannot resolve symbol 'intellij'" syntax errors like for example on this line:

 
new com.intellij.uiDesigner.core.GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1));

Any idea what I did wrong?

Thanks for the help!

0
Comment actions Permalink

Got it working, you're a lifesaver. Thanks again!

0
Comment actions Permalink

I have no idea where to find or get "IDEA_HOME\redist\forms_rt.jar" it simply isn't on my computer and I'm not sure how to get new libraries or Mavens I'm kind of lost.

0
Comment actions Permalink

The forms_rt.jar file seems to be located at "IDEA_HOME/lib/forms_rt.jar" now.

0
Comment actions Permalink

I found the .jar file and added it to the project, then i rebuild it but when i try to run it using another ide it doesn't work, what should i do? :(

0
Comment actions Permalink

Apple 

What IDE are you trying to run it in? Is there any error message?

Please attach screenshots of your project in IDEA with output folder expanded to show its contents, and also Project Structure | Modules | Dependencies dialog showing forms_rt.jar added to the module.

1
Comment actions Permalink

Arina Efremova

Thanks, but i realized what the problem was, i was using an absolute path for the .jar file so there was no way it could run in another ide and even less another machine. I just put it as a library of the project and it compiled and runned just fine :D

0
Comment actions Permalink

Apple Great, good to know👍

0

Please sign in to leave a comment.