This Activity allows you to develop a MIDlet which contains a high level user interface.
You will be using the MIDlets TextBoxExample and Resources from Unit 10.
The code of class TextBoxExample has been added as a text file to this project for you to amend.
You are going to follow the steps taken in the last activity to create a new project containing your MIDlet. You will develop your MIDlet from the TextBoxExample MIDlet in the unit.
The new MIDlet will have an extra option to the three given in the unit. This option will be called LOGO and it will put a standard message onto the ticker. This message will be stored as a text file - LogoFile.txt - in the res folder of the MIDlet.
The advantage of storing the text in the res folder is that it is easy to change the text without having to re-compile the MIDlet itself.
Follow the instructions from Activity 4 to create a new project and MIDlet called TextBoxExample. The package should be named textboxexample. You can copy the code for the MIDlet from the text file TextBoxExample.txt provided with this project.
Compile and run the project.
Now add an extra option to the menu called LOGO. Initially, the text to be used in the ticker should be from a string variable called logo and should have the text - "The Open University". Re-compile and run.
Now adapt the new code, which you have just entered so that the text is taken from a file called logoFile which contains the same text as logo, stored in the res folder. You should consult the code for the Resources MIDlet to see how to modify the code.
Now we need to create the res folder and the text file containing the message. Right-click on the project node and select New|Java Package... Name the package res and click Finish. The new package should appear in the Projects window. This package represents the folder into which the text file must go. One way to do it is go into Windows, create the text file logoFile.txt (note the file name is case-sensitive) and paste it directly into the res folder, which you will find inside the src folder for the TextBoxExample project.
Alternatively you can right-click on the res node in the Projects window, select New|Empty File... and the New Empty File wizard will appear. (If you cannot see the Empty File... option on the menu, select New|File/Folder... and the New File wizard will appear. Select Other under Categories: and Empty File under File Types: then click Next.) Name the file logoFile.txt. This will open an empty file in the Edit window and you can type in the text, then save it using File|Save or Ctrl+S.
Re-compile and run the modified project.