To convert from AWT to AFC, instances of java.awt.Frame should be transformed into instances of com.ms.ui.UIFrame.
Frame extends Window: be sure to see its changes.
AFCs UIFrame class replaces Frame and takes advantage of what UIComponent provides. When using AFC, you may sometimes need a reference to a Frame (from java.awt.frame), like when using java.awt.FileDialog or another class. If you have a current UIFrame, you can get the underlying Frame by using the method getFrame().
This is the set of changes you need to make to port all Frame methods to UIFrame methods. Any method not listed here or below does not need to be changed.
AWT Code | AFC Code | Comments |
Frame() or Frame(String) |
UIFrame() or UIFrame(String) |
The int refers to the style--see above. |
Some methods in java.awt.Frame are not directly supported in com.ms.ui.UIFrame. Those methods and suggested changes are described here.
AWT Code/Suggested AFC Code | Comments |
dispose() (no suggestions) |
|
getCursorType() getCursor() |
getCursor is a method of UIComponent that returns a Cursor object, not an int: getCursorType is Deprecated in AWT 1.1, replaced with something similar to AFC's getCursor. |
getMenuBar() (use UIBand) |
In AFC, there is not one menu bar: instead, you put menus on UIBands and then place the UIBand where you like. See MenuBar for more information about how this works. |
isResizable() (no suggestions) |
|
paramString() getName(), etc. |
Use the getXXX function that provides the information you need. |
remove(MenuComponent) (use UIBand) |
AFC does not use MenuComponents: instead, menu parts are put in UIComponents. See MenuBar for more information. |
setCursor(int) setCursor(Cursor) |
AWT's setCursor is Deprecated in AWT 1.1. |
setIconImage(Image) (no suggestions) |
|
setMenuBar(MenuBar) (use UIBand) |
In AFC, there is not one menu bar: instead, you put menus on UIBands and then place the UIBand where you like. See MenuBar for more information about how this works. |