|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
This page lists simple name changes between the 1.0 and 1.1 releases of the AWT. These name changes can be performed automatically by a script such as thesedscript we provide. See How to Convert Code that Uses the AWT for instructions on using thesedscript.The name changes listed in the following table are not valid for non-AWT code. At least one isn't even valid for all AWT code. Since the
sedscript can't tell what type of object it's affecting, you might find it making incorrect changes, which you'll generally discover when you see compilation error messages such as the following:When you see such an error message, check whether the script incorrectly changed a method name. If you find the method name in the second column of the table below, look in the first column to see the method's original name. You can then edit the program by hand, changing the error-causing line to use the original name. For example, to correct the error above, you should changeCardWindow.java:40: Method setVisible(java.awt.Panel, java.lang.String) not found in class java.awt.CardLayout. ((CardLayout)cards.getLayout()).setVisible(cards,(String)arg);setVisibletoshowon line 40 of theCardWindow.javafile.
Note: To see a complete list of deprecated AWT methods (1.0 methods no longer recommended in 1.1), see Deprecated Methods in the AWT.
Original Method Name 1.1 Method Name addItemaddappendTextappendinsidecontainslayoutdoLayoutgetPageIncrementgetBlockIncrementbounds
getBoundingBoxgetBoundsgetClipRectgetClipBoundslocategetComponentAtcountComponentsgetComponentCountinsetsgetInsetscountItemsgetItemCountlocationgetLocationcountMenusgetMenuCountminimumSizegetMinimumSizepreferredSizegetPreferredSizegetCurrentgetSelectedCheckboxgetLineIncrementgetUnitIncrementgetVisiblegetVisibleAmountinsertTextinsertisSelectedisIndexSelectedallowsMultipleSelectionsisMultipleModedelItemremoveclearremoveAllreplaceTextreplaceRangesetPageIncrementsetBlockIncrementreshapesetBoundssetEchoCharactersetEchoChardisable()setEnabled(false)enable()setEnabled(true)enable(expression)setEnabled(expression)movesetLocationsetMultipleSelectionssetMultipleModesetCurrentsetSelectedCheckboxresizesetSizesetLineIncrementsetUnitIncrementhidesetVisible(false)show()setVisible(true)show(expression)setVisible(expression)nextFocustransferFocus
|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.