Modify an application to support localization.
Prerequisite: You should complete the lab entitled Creating a User Interface before you start this exercise.
- Discover how to create string resources in the IDE.
- Discover how to use resources in your code.
- Extract CityInfoB_Incomplete.zip
- In the IDE, open the cityinfob.jdw workspace
- Open the CityInfoB.java source file.
- Add a resource header (.rrh) file to the cityinfob project.
- Add a resource content (.rrc) file to the cityinfob project.
- Add resources for each text string that is used in the application. Refer to the text file included in the cityinfob project for a list.
- Open the CityInfoB.java source file.
- Import the necessary package for localization.
- Add code to retrieve a ResourceBundle.
- Replace string literals by retrieving the appropriate resource.
(In CityInfoB_complete)
In this exercise, you discovered the following things:
- how to work with the IDE resource editor to create language resources
- how to use language resources in application code