Create the user interface
You will now create a simple user interface for the client application. This will consist of two screens: a text entry screen for entering queries, and another screen for displaying results.
- From the Displayables tab of the Mobile Devices Palette, drag a Text Box onto the Display node of the MIDlet Composer. If the Text Box was properly dragged to the tree, it will appear under Display in the tree, and also in the Emulator as a new screen with a name similar to TextBox0.
In the property sheet of the TextBox, change some starting properties.
- Change the Object Name of the TextBox to 'query'.
- Change the Title to 'Query'.
- Change the Starting text to 'printer'.
Next you will drag three commands to the Text Box which will provide functionality for your program.
- Choose the Commands tab of the Mobile Devices Palette.
- Drag a Command onto the query node in the tree. It will show up in the tree with a name similar to Command1.
- Repeat this two more times so you have three commands. Don't worry about the order of the commands; you will rename them all.
- Change the Command label in the property sheet of the third command to Clear.
- Change the Command priority of the command to '2'.
- Select the second command in the tree. The property sheet to the right will show the information for this command.
- Change the Command label of the second command to 'Exit'.
- Change the Command type of the second command to Exit.
- Select the remaining command in the tree.
- Change the Command label of the remaining command to Query.
Now you will add the second screen of the client which will be used to display the results of the query.
- Choose the Displayables tab of the Mobile Devices Palette.
- Drag a Form onto the Display node of the MIDlet Composer, beneath the query node which is already there. If you accidentally drag the form above the query node, you should drag the form again so the query node appears above the form in the tree. The order matters here because the query node should be the first screen of your application.
- The new form should have a name similar to form2. Change the Object Name of the form to 'results'.
- Change the Title to 'Results'.
- Choose the Form Items tab of the Palette. Drag a String Item onto the results form.
- Drag a Command from the Commands tab of the Palette to the results form.
- Change the Command label of the command to Back.
- Change the Command type of the command to Back.
- Change the then goto of the command to query.
You have now created the user interface for your client application.
| Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |