Java Code Generator

Java code generator

JFormDesigner can generate and update Java source code. It uses the same name for the Java file as for the Form file. E.g.:

C:\MyProject\src\com\myproject\WelcomeDialog.jfd (form file)
C:\MyProject\src\com\myproject\WelcomeDialog.java (java file)

Note: If you use the runtime library, you can disable the code generator in the Java Code Generator preferences.

Generation of nested classes

The Java code generator is able to generate and update nested classes. You can specify a class name for each component in your form. This allows you to organize your source code in an object-oriented way.

Code templates

When generating new Java files, nested classes or event handlers, JFormDesigner uses code templates specified in the Templates preferences.

Java 5 support

The Java code generator can generate source code that uses Java 5 language features (e.g. auto-boxing, @Override, etc). You can also use Java 5 enums as property values and set annotations for component variables.

Generate Eclipse or NetBeans non-nls tags

The Java code generator can write Eclipse non-nls tags (//$NON-NLS-n$) and NetBeans no-i18n tags (//NOI18N). Enable it in the Java Code Generator preferences.