9

I have made an extremely simple project in IntelliJ's IDEA, basically just a form with a JToolBar containing a JButton, and when I try to launch it, I get an NPE in form.$$$setupUI$$$ - but no such thing is reflected in the actual form.java, so I have no way to debug it or track down the bug.

Is there a way to make IDEA show (and maybe even let me change) the 'magically' generated code ?

1
  • 1
    Just so future readers know: You shall NOT change the generated source code! Your changes will be overriden the next time the code is being generated. It also reminds you in the comments that are being generated along with the code. You may track down your problem that way just fine, but then you have to fix it outside of the $$$setupUI$$$() method. Screenshot from 14.1.4: i.imgur.com/vfD2nD4.png Also, see this, section "Generate GUI Into": jetbrains.com/idea/help/gui-designer.html i.imgur.com/bNcBQ07.png
    – randers
    Sep 6, 2015 at 16:59

2 Answers 2

10

Settings | GUI Designer | Generate GUI into | Java source files.

2

File > Settings > GUI Designer >Generate GUI into Java source code

(see: https://grahamwideman.wikispaces.com/Java+IntelliJ+GUI+app+notes)

2
  • you saved my day. Do you know a maven plugin for that, because I build with maven and cannot used Idea byte weaving, but Idea source code generation spoils git history. Mar 2, 2016 at 11:48
  • 1
    ideauidesigner-maven-plugin is way to go Mar 2, 2016 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.