![]() |
![]() |
![]() |
![]() |
Cleaning up
You have finished placing all of the components that you will need for the simple tip calculator. You will now go through your GUI and clean up the components you created. First you will set up the title of your application.
- Click on the TextBox titled 'textBox1' in the Emulator. You will see the Properties page for this TextBox appear in the Composer.
- Change the TextBox text from 'textBox1' to 'Tip Calculator' by typing in the text area of the Composer window. Note that the text changes immediately in the Emulator as you type. If you did not change the size of the TextBox, the TextBox will wrap the text to two lines because it is too long to fit onto one.
- You can change the height and width of the TextBox by editing the numbers in the Size box on the Properties page. Set the height to 15, and the width of the TextBox to 80. This should be big enough to put all of the text on one line. When you change the width of the TextBox, a warning symbol may appear in the upper left hand corner of the Emulator window. Pressing this symbol will cause the warning associated with it to be displayed in the Java Console.
- Next you will set up the TextField where you can enter the amount of the bill. You can switch to the property sheet for this part by clicking 'textField2' in the Emulator. The property notebook for textField2 should appear in the Composer.
- Change the TextField label from 'textField2' to 'Bill Amount $'. Note that you do not have to type the ':' which appears in the Emulator; that is added automatically by the TextField.
- Each component is given a name which you use to refer to each component when you write Java code. The current Object name is set to 'textField2'. Change it to a simpler, more descriptive name, 'amount'.
- To edit the properties of the next TextField, you could click on it in the Emulator. You can also choose a part from the Parts List, which is located in the middle of the button bar of the Composer. Select 'textField3' from the list. You will see the properties notebook for this part.
- Change the TextField label from 'textField3' to 'Percentage'. Change the Object name to 'percentage'.
- Choose the properties notebook of the button by selecting 'button4' in the Parts List.
- Change the Button text from 'button4' to 'compute tip'.
- Finally, choose the last TextBox, textBox5 from the Parts List.
- Change the TextBox text to '$tip' and the Object name to 'tip'.
- Change the height of the TextBox to 15.
You have now set up the GUI for the Tip Calculator. If you decide that you need to change the location of some parts (for example, if the tip TextBox is too low on the screen) you can use the mouse to move the parts around so they all fit. After you have finished moving the parts around, go to the first part in the Parts List, TipCalculator, and uncheck the checkbox labeled 'Edit locations using mouse'. All the red squares in the Emulator will disappear, and the Emulator will now display your application exactly the way it will appear when run on the Palm OS Platform.
Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |
![]() |
![]() |
![]() |
![]() |