Start of Tutorial > Start of Trail > Start of Lesson | Search |
Here's an example of using theupdateAWT
script to help convert a 1.0 AWT program to the 1.1 API. The example shows the commands you might enter at a shell prompt on a UNIX system.
- Run the script:
% cp MyClass.java OldMyClass.java % updateAWT MyClass.java > tmp.java
- Check the changes to make sure nothing obviously bad happened. For example, on a UNIX system, you might execute the following command:
% diff MyClass.java tmp.java
- After confirming that the changes look OK, save the new version of the program:
% mv tmp.java MyClass.java
- Try recompiling the program to make sure that the script didn't incorrectly convert a method name. Be sure to use a 1.1 compiler.
You might still get a few deprecation warnings, but you shouldn't get any compile errors.% javac MyClass.java
- If the program doesn't compile, you probably have to undo a change the script made. See Simple Name Changes for help.
Start of Tutorial > Start of Trail > Start of Lesson | Search |