AFC Bean Sample
This sample is located in \Samples\ActiveX\AFCBean.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
Description
This sample Bean shows how to write a pure AFC object and host it inside a Microsoft® ActiveX® container. The sample shows how AFC objects can source events that are caught by the HTML page, expose methods and properties, and use the PropertyViewer class to dynamically change the attributes of an object at runtime.
You must have Microsoft® Internet Explorer 4.0 or later installed to use this sample.
Using the Sample
To use the sample
The applet initially displays a blank panel followed by a set of buttons and fields. You can perform the following actions with this sample:
- Click the Populate button to add 50 items and a scroll bar to the panel. This button uses JavaScript to populate the panel.
- Type new text and click the Add Item button to add the text at the end of the items list.
- Type the item index number and click the Select Item button to move to that item in the list.
- As you select items with the mouse or keyboard, the item number displays in the field labeled Sinks the Event Item Selected and Displays the String. The event is being fired from AFCBean and caught by the HTML page.
- Click the Property Viewer button to display the selected item's properties. You can also change the properties at runtime. The Property Viewer button uses the Bean's PropertyViewer.
Key Project Files
AFCBean.java
This class extends AwtUIApplet, creates an implementation class containing the UI components, implements the property viewer, registers event listeners, and fires events to a script.
AFCBeanListener.java
This class defines an interface for listening to the AFCBean events.
Technologies Demonstrated
ActiveX/Beans
- This sample shows how to host a Bean in an ActiveX container.
AFC/AWT
- This sample shows how to create an AFC applet using AWT compatibility classes (AwtUIApplet).
Event Handling
- This sample shows how Java applets can fire events to scripts.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.