DRAFT. Feedback to Kathy Walrath.
Back to "How to Convert..."

Name Changes in the 1.1 AWT

The table at the bottom of this page lists simple name changes between the 1.0 and 1.1 versions of the AWT. With one exception, the listed changes are automatically performed by the sed script we provide.

The exception is that the size method isn't automatically converted to getSize. We decided not to do this particular conversion because the commonly used Vector class still has a frequently used method named size.

Fixing Incorrectly Changed Names

The name changes listed in the table are not valid for non-AWT code. Some aren't even valid for all AWT code. Since the sed script 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:
CardWindow.java:40: Method setVisible(java.awt.Panel, java.lang.String) not
found in class java.awt.CardLayout.
	    ((CardLayout)cards.getLayout()).setVisible(cards,(String)arg);
When you see such an error message, check whether the script incorrectly changed a method name. Looking at the table below, you can see the method's original name. The solution is to edit the program by hand -- changing the error-causing lines to use the old name. For example, for the error message above you would change setVisible to show on line 40 of the CardWindow.java file.

The Table

Old Method Name 1.1 Method Name
addItem add
appendText append
inside contains
layout doLayout
getPageIncrement getBlockIncrement
bounds
getBoundingBox
getBounds
getClipRect getClipBounds
locate getComponentAt
countComponents getComponentCount
insets getInsets
countItems getItemCount
location getLocation
countMenus getMenuCount
minimumSize getMinimumSize
preferredSize getPreferredSize
getCurrent getSelectedCheckbox
size getSize
This change is not performed by the script.
getLineIncrement getUnitIncrement
getVisible getVisibleAmount
insertText insert
isSelected isIndexSelected
allowsMultipleSelections isMultipleMode
delItem remove
clear removeAll
replaceText replaceRange
setPageIncrement setBlockIncrement
reshape setBounds
setEchoCharacter setEchoChar
disable setEnabled(false)
enable setEnabled(true)
enable(expression) setEnabled(expression)
move setLocation
setMultipleSelections setMultipleMode
setCurrent setSelectedCheckbox
resize setSize
setLineIncrement setUnitIncrement
hide setVisible(false)
show() setVisible(true)
show(expression) setVisible(expression)
nextFocus transferFocus


Back to "How to Convert..."