Form Editor modes
The Form Editor can be in one of three modes:
Table 8: Form Editor modes
|
|
|
Design mode. This is the default Form Editor mode. By clicking on the form you can select, add, or drag components. Note that in this mode, depending on the layout, the layout won't necessarily look the same as it does during run-time. This is because design would be difficult if every layout manager worked exactly the same way at design time as it does during run time. For example, with some layout managers, when you drop two components next to each other, they could resize automatically and make it impossible to add a new component between the two. So, if you need to see the effect of a certain layout manager at run time, change the Form Editor from design mode to either real mode or test mode.
|
|
Real mode. The Form Editor window displays the actual Java layout managers, so the forms look the way they will during run-time. You can select or add components, but dragging components is disabled.
|
|
Test mode. Similar to real mode, the form behaves exactly the same as during run-time. When clicking on the form, the mouse events are delivered to the actual components. Thus, for example, a button looks "pressed" when you click on it. This mode is suitable for checking the look and feel of the form without the need to compile and run it.
|
To switch between design and real mode, use the Design Mode icon (the square with a pound sign inside) from the toolbar. If the icon is selected (as shown in the design mode example above), you are in design mode. Otherwise, you are in real mode.
Switching to test mode is done using the Test Mode icon on the toolbar; this is a toggle button, which means you click to enable it and click again to disable. Note that switching test mode on disables the Design Mode icon; to enable it again, test mode must be switched off.
These modes are kept separately for each form.
Note: When test mode is switched on, the form is resized to its preferred size - this is how it looks if it is not explicitly resized by calling setSize()
or setBounds()
.