### Code Generation

The Forms Designer can generate Java source code from a form. However, this is a forward-only operation. Java source cannot be reverse engineered back to a form. The feature is provided so you can completely decouple your code from the forms runtime library.

Since the forms runtime is open source under the BSD license, the only reason to use code generation is to remove any dependencies from the forms runtime. However, the forms runtime has capabilities that are not directly available in the JDK. Since generated code will not include any forms runtime dependencies, the resulting GUI will only contain a subset of what might be available in the designer. Specifically, code generation does not include the following:

- Fill effects such as gradients and textures.
- Horizontal or vertical line components.
- Some line borders.
- JList items
- JComboBox item icons.
- ImageComponents. If you want to use images, you must define them in a JLabel or JButton.

The generated code does depend on the FormLayout library. You can download this library from:https://forms.dev.java.net

To generate the Java code for a form, simply select the Code Generation item in the Tools menu. This will show a dialog with the generated code. You can press the Options button to change some of the formatting and generation rules.