java - Swing GUI Builder Intellij IDEA -
i can't seem run form on intellij gui builder
exception in thread "main" java.awt.illegalcomponentstateexception: contentpane cannot set null.
i assume code initialize views auto generated. right have jpanel
, somehow not auto-initialized thought it's visible on designer.
it's gradle project , i've chosen run generated main function.
what have working?
public class myform { private jpanel jpanel; public static void main(string[] args) { jframe frame = new jframe("myform"); frame.setcontentpane(new myform().jpanel); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.pack(); frame.setvisible(true); } }
by default, intellij idea ui designer works generating bytecode, unfortunately not supported gradle builds. can change generate source code in settings | editor | gui designer.
Comments
Post a Comment