Download Forte for Java (Community Edition) User's Guide

Transcript
Chapter 6: Designing Visual Classes with the Form Editor
Adding menu items
The Component Inspector displays the hierarchy of menu bars and popup menus under
Non-visual Components . Every menu (whether it is on a menu bar or it is a popup
menu or submenu) starts with one menu item, displayed as a subnode.
To add new menu items, submenus, or separators to a menu bar or popup menu:
1
In the Component Inspector, select the menu you would like to add an item to.
2
Right-click on the menu and choose New and then the item you want from the submenu.
Menu item events
You can use the same mechanism for assigning event handlers to menu items as with any
other component. For menu items, you can also add the actionPerformed event handler
by actually selecting the item from the menu in the Form Editor window.
To add an event handler to a menu item:
1
Select the component in the Component Inspector and either use the popup menu or
event properties to attach the event handler.
2
Use the Connection Wizard by clicking on the Connect icon and then (in the Component
Inspector) clicking on the connection source and target. See “Using the Connection
Wizard”on page 135.
Components with special support
Forte for Java, Community Edition's Java-based architecture enables it to support interactive
design with components including the AWT ScrollPane and the Swing JScrollPane,
JTabbedPane, JTable, JList, JDesktopPane, and JSplitPane.
In general, these components are used the same way as other components. Forte for Java
provides special support in the form of features such as custom property editors which
simplify some of the more complex aspects of designing forms.
JScrollPane, ScrollPane
In many cases, AWT components pop up their own scroll bars if their content needs to scroll.
An AWT ScrollPane is available, though, to add scrolling where it is needed. Swing
components, however, must be added to a JScrollPane if the content is to scroll. This
143