|
|
|||||||||||||
Class UIAwtHostpublic class UIAwtHost extends UICanvas { // Constructors public UIAwtHost(Component comp); // Methods public Component getComponent(); public boolean postEvent(Event e); } This class is an AWT host control that enables AWT-based components to be used in AFC containers. The following example shows how to use the AWT host to include an AWT Button object in a UIPanel object.
// Create an AFC panel and an AWT button. UIPanel p = new UIPanel (); Button b = new Button ("AWT Button"); // Add button to panel using UIAwtHost bridge. p.add (new UIAwtHost (b)); Events propagating to the host control are re-targeted before being propagated up the containment hierarchy, so the host becomes the target for these events. The host control supports event propagation for only one level of containment. Events associated with any components contained by the component being hosted are consumed by the host control and do not propagate further. To catch these events, you must override the postEvent method. UIAwtHost will not propagating any events whose target is an AWT component and not the component being hosted. Note The UIAwtHost control cannot be used inside an AFC choice (UIChoice) control. If used inside a menu list (UIMenuList), the menu list cannot be launched as a pop-up menu. UIComponent | +--UIStateComponent | +--UICanvas | +--UIAwtHost ConstructorsUIAwtHostpublic UIAwtHost(Component comp); MethodsgetComponentpublic Component getComponent(); postEventpublic boolean postEvent(Event e);
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |