Trail: To 1.1 -- And Beyond!
|
Lesson: Migrating to 1.1
|
|
Platform-specific Details: Using the updateAWT Script
Here's an example of using the
updateAWT 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.
% javac MyClass.java
You might still get a few deprecation warnings,
but you shouldn't get any compile errors.
- If the program doesn't compile,
you probably have to undo a change
the script made.
See Simple Name Changes
for help.
|