Documentation

Contents

 

Properties View

The Properties view displays and lets you edit the properties of the selected component(s). Select one or more components in the Design or Structure view to see its properties. If more than one component is selected, only properties that are in all selected components are shown.

The view consists of two tabs (at the bottom of the view).

Properties tab

The Properties tab displays the component name, component class, layout properties, client properties and component properties. The list of component properties comes from introspection of the component class (JavaBeans).

Properties View - Properties tab

   

By default, the Properties view displays regular properties. To see expert properties, click on the Show Advanced Properties () button in the view toolbar and to see read-only properties, click the Show read-only Properties () button.

Different font styles are used for the property names. Bold style is used for preferred (often used) properties, plain style for normal properties and italic style for expert properties. Read-only properties are shown using a gray font color.

The light gray background indicates unset properties. The shown values are the default values of the component. The white background indicates set properties. Java code will be generated for set properties only. Use Restore Default Value () to unset a property. Use Set Value to null () from the popup menu to set a property explicitly to null.

The left column displays the property names, the right column the property values. Click on a property value to edit it.

String Property Editor

You can either edit a value directly in the property table or use a custom property editor by clicking on the ellipsis button () on the right side. The custom editor pops up in a new dialog. The globe button (property_globe_button.png), which is only available for localized forms and string properties, allows you to choose existing strings from the resource bundle of the form.

The type of the editor depends on the data type of the property. JFormDesigner has built-in property editors for all standard data types.

For numbers, a spinner editor makes it easier to increase or decrease the value using the arrow buttons or Up and Down keys. Press the Enter key to confirm the change; or the Esc key to cancel it.

Number Property Editor

Common properties (at the top of the table):

Property Name Description
Name The name of the component. Must be unique within the form. Used as variable name in the generated Java code. It is also possible to specify a different variable name on the Code Generation tab.
Class The class name of the component. The tooltip displays the full class name and the class hierarchy. Click on the value to morph the component class to another class (e.g. JTextField to JTextArea).
Button Group The name of the button group assigned to the component. This property is only visible for components derived from JToggleButton (e.g. JRadioButton and JCheckBox).
Layout Layout properties of the container component. Click on the plus sign to expand it. The list of layout properties depends on the used layout manager. This property is only visible for container components. Click on the value to change the layout manager.
Constraints Layout constraints properties of the component. Click on the plus sign to expand it. The list of constraints properties depends on the layout manager of the parent component. This property is only visible if the layout manager of the parent component uses constraints.
Client Properties Client properties of the component. Click on the plus sign to expand it. This property is only visible if there are client properties defined in the Client Properties preferences.

Code Generation tab

This tab displays properties related to the Java code generator.

Properties View - Code Generation tab

Property Name Description
Nested Class Name The name of the generated nested Java class. See Nested Classes for details.
Variable Name The variable name of the component used in the generated Java code. By default, it is equal to the component name.
Variable Modifiers The modifiers of the variable generated for the component. Allowed modifiers: public, default, protected, private, static and transient. Default is private.
Use Local Variable If true, the variable is declared as local in the initialization method. Otherwise at class level. Default is false.
Gen. Getter Method If true, generate a public getter method for the component. Default is false.
Variable Annotations (Java 5) Annotations of component variable (Java 5).
Type Parameters (Java 5) Parameters of component type (Java 5). E.g. MyTypedBean<String>.
Custom Creation Code Custom code for creation of the component.
Pre-Creation Code Code included before creation of the component.
Post-Creation Code Code included after creation of the component.
Pre-Initialization Code Code included before initialization of the component.
Post-Initialization Code Code included after initialization of the component.

This is the dialog for custom code editing:

Custom Code Dialog

"(form)" properties

Select the "(form)" node in the Structure view to modify special form properties:

Properties tab

Property Name Description
Set Component Names If true, invokes java.awt.Component.setName() on all components of the form.

Code Generation tab

Property Name Description
Generate Java Source Code If true, generate Java source code for the form. Defaults to "Generate Java source code" option in the Java Code Generator preferences.
Default Variable Modifiers The default modifiers of the variables generated for components. Allowed modifiers: public, default, protected, private, static and transient. Default is private.
Default Use Local Variable If true, the component variables are declared as local in the initialization method. Otherwise at class level. Default is false.
Default Gen. Getter Method If true, generate public getter methods for components. Default is false.
Default Handler Modifiers The default modifiers used when generating event handler methods. Allowed modifiers: public, default, protected, private, final and static. Default is private.
Member Variable Prefix Prefix used for component member variables. E.g. "m_".
Use 'this' for member variables If enabled, the code generator inserts 'this.' before all member variables. E.g. this.nameLabel.setText("Name:");
I18n Initialization Method If enabled, the code generator puts the code to initialize the localized texts into a method initComponentsI18n(). You can invoke this method from your code to switch the locale of a form at runtime.
I18n 'getBundle' Template Template used by code generator for getting a resource bundle. Default is ResourceBundle.getBundle(${bundleName})
I18n 'getString' Template Template used by code generator for getting a string from a resource bundle. Default is ${bundle}.getString(${key})
I18n Key Constants Class The name of a class that contains constants for resource keys.

« previous | next »