IntelliJ idea gui designer + maven

寵の児 提交于 2019-11-28 12:01:58

You must include ideauidesigner-maven-plugin:

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>ideauidesigner-maven-plugin</artifactId>
            <version>1.0-beta-1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>javac2</goal>
                    </goals>
                </execution>
            </executions>

            <configuration>
                <fork>true</fork>
                <debug>true</debug>
                <failOnError>true</failOnError>
            </configuration>
        </plugin>
    </plugins>
</build>

and optionally - if you use GridLayoutManager or JGoodies - include also forms_rt as dependency:

    <dependency>
        <groupId>com.intellij</groupId>
        <artifactId>forms_rt</artifactId>
        <version>7.0.3</version>
    </dependency>

I had the same problem with building my project with maven. What solved my problem was to change the value for "Generate GUI into:" from "Binary class files" --> "Java source code" in the settings (found in Project|Settings|Editor|GUI Designer).

I've found decision by myself. http://glxn.net/2010/08/17/making-a-swing-project-using-intellij-idea-and-gui-builder-with-maven-including-executable-jar/ You need special plugin to make maven projects with intelliji idea gui designer.

In your dynamic initializer (the part with the {{}}), you are accessing directLineOkButton:

directLineOkButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
               //some action
                }
            }
        });

However, that field hasn't been assigned yet, so you get a NullPointerException.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!