Add Labels by DragNDrop style. Click the Selection Mode icon and the Label icon. To test the form, click the Test Form Icon at the Design Panel to see the current

J.E.D.I

4. Add Labels by DragNDrop style. Click the Selection Mode icon and the Label icon.

Then, drag and drop it to the Design window. Notice the message at the footer of the program showing Add Label to p1. Figure 5.21 shows this. Software Engineering 248 Figure 5.21 Adding a Label J.E.D.I 5. The Component Inspector shows now that Label label1 was added to Panel p1 and the Properties Tab now shows the Properties, Events, and Code for that label. Figure 5.22 shows this. Software Engineering 249 Figure 5.22 Sample Label1 and Properties J.E.D.I 6. Adding GUIs to the Design can also be made by right-clicking the frame or panel in the Component Inspector. This is shown in Figure 5.23. Software Engineering 250 Figure 5.23 Right-clicking Frame or Panel J.E.D.I 7. Continue adding and modifying the properties of the succeeding Labels, TextFields, TextArea, Buttons and the Check boxes to Panel p1 and do the same in Panel p2. You can also drag and drop between panels as well. A sample of AForm.java is shown in Figure 5.24 with additional windows component. Software Engineering 251 Figure 5.24 Sample AForm.java J.E.D.I

9. To test the form, click the Test Form Icon at the Design Panel to see the current

layout. Figure 5.25 and Figure 5.26 show what happens. Software Engineering 252 Figure 5.25 Clicking Test Form Icon Figure 5.26 Running the Test Form J.E.D.I 10.Right-Click GridBagLayout at the Component Inspector. Select Customize to be able to fix the layouts by dragNdrop style as well. The Customizer Window will be displayed. Figure 5.27 shows an example. Software Engineering 253 Figure 5.27 GridBagLayout Customizer J.E.D.I 11.DragnDrop the components in their right locations in the way it is shown on the Figure 5.28. Software Engineering 254 Figure 5.28 New Positions J.E.D.I Close it and click the Test Form icon to see the differences. The screen should more or less look like the screen in Figure 5.11. Software Engineering 255 Figure 5.29 New GridBagLayout J.E.D.I Notice that everything is centered. Go back to the GridBagLayout - Customize, to edit the Anchor values of each, as well as other necessary modifications. The final layout when AForm.java is executed BUILD or Shift+F6 should look like Figure 5.3. Software Engineering 256 Figure 5.30 New Form Layout J.E.D.I 12.To add dialogs to the form, go to Component Inspector, right-Click Other Components. Select Swing - JDialog. Do the same process for the layouts. Software Engineering 257 Figure 5.31 Adding a Dialog J.E.D.I 13.To enable the event for the Find button in the Athlete Form, right-click its name at the Component Inspector. Select Events - Action - actionPerformed. Software Engineering 258 Figure 5.32 Enabling Events for the Form J.E.D.I This will select the Source tab beside the Design tab of the Design window. Modify the code in such a way that it will make the Find An Athlete Dialog visible. Do the same for the OK and Cancel Button in the Dialogs. Software Engineering 259 Figure 5.33 Setting Find Athlete Dialog Visible J.E.D.I 14.Test the form. From the Athlete Form, click Find Button. It should display Find An Athlete Form. From this form, click OK button. It should display Athlete List Form. 15.Rebuild and Run. Software Engineering 260 Figure 5.34 Testing all the forms J.E.D.I

5.7 Controlling the Version of the Software