Beans as ActiveX Controls

By design, the Bean standard is compatible with binary component standards, including OpenDoc and ActiveX. Microsoft provides a command-line utility, regbean, that generates type library information and registers a Bean as an ActiveX control. To make SlideshowBean compatible with ActiveX, I use the following command.

regbean coyote\bean\SlideshowBean.class new

The new parameter tells regbean to generate a new CLSID for SlideshowBean; I could have replaced new with a CLSID in braces to identify the component with a CLSID of my own choice. The regbean utility would then have produced the following output.

Microsoft (R) Java(tm) Beans Registration Utility
Copyright (C) Microsoft Corp 1997. All rights reserved.

Setting code base to
 file:C:\WINDOWS\JAVA\CLASSES\coyote\bean\
loading object...
saving type library...

Java class coyote.bean.SlideshowBean.class successfully registered.
Using CLSID {a996dac0-bf4c-11d0-be9b-ad92d0e6814a}

When I run the Java Type Library Wizard on the resulting .tlb file, the wizard shows that regbean created the following interfaces by analyzing SlideshowBean.class.

public class slideshowbean/SlideshowBean extends
    java.lang.Object
{
}

public interface slideshowbean/SlideshowBean_Events
    extends com.ms.com.IUnknown
{
    public abstract void componentShown(java.lang.Object);
    public abstract void mouseClicked(java.lang.Object);
    public abstract void mouseDragged(java.lang.Object);
    public abstract void componentResized(java.lang.Object);
    public abstract void mousePressed(java.lang.Object);
    public abstract void componentHidden(java.lang.Object);
    public abstract void mouseMoved(java.lang.Object);
    public abstract void keyPressed(java.lang.Object);
    public abstract void keyTyped(java.lang.Object);
    public abstract void mouseReleased(java.lang.Object);
    public abstract void focusLost(java.lang.Object);
    public abstract void keyReleased(java.lang.Object);
    public abstract void mouseExited(java.lang.Object);
    public abstract void mouseEntered(java.lang.Object);
    public abstract void focusGained(java.lang.Object);
    public abstract void componentMoved(java.lang.Object);
}

public interface slideshowbean/SlideshowBean_Dispatch
    extends com.ms.com.IUnknown
{
    public abstract boolean gotFocus(java.lang.Object,
        java.lang.Object);
    public abstract boolean lostFocus(java.lang.Object,
        java.lang.Object);
    public abstract java.lang.Object createImage(int, int);
    public abstract void setBounds2(java.lang.Object);
    public abstract void hide();
    public abstract float getAlignmentY();
    public abstract int getbackground();
    public abstract void putbackground(int);
    public abstract void repaint4(int, int, int, int);
    public abstract void enable(boolean);
    public abstract boolean isVisible();
    public abstract void disable();
    public abstract void list5(java.lang.Object, int);
    public abstract void doLayout();
    public abstract void layout();
    public abstract java.lang.Object getClass();
    public abstract java.lang.Object
        getComponentAt(java.lang.Object);
    public abstract boolean isValid();
    public abstract boolean isShowing();
    public abstract void addNotify();
    public abstract boolean mouseUp(java.lang.Object, int,
        int);
    public abstract void displayImage(java.lang.Object);
    public abstract void toFront();
    public abstract java.lang.Object getComponentAt2(int,
        int);
    public abstract boolean keyUp(java.lang.Object, int);
    public abstract java.lang.Object 
        getFontMetrics(java.lang.Object);
    public abstract java.lang.Object getGraphics();
    public abstract void
        removeSlideshowListener(java.lang.Object);
    public abstract void
        addComponentListener(java.lang.Object);
    public abstract void addKeyListener(java.lang.Object);
    public abstract java.lang.Object getTreeLock();
    public abstract void
        addMouseMotionListener(java.lang.Object);
    public abstract void run();
    public abstract void repaint2();
    public abstract void wait2(long);
    public abstract java.lang.Object location();
    public abstract java.lang.Object getLocation();
    public abstract void stop();
    public abstract void setLocation(java.lang.Object);
    public abstract void add(java.lang.Object);
    public abstract void drawNext();
    public abstract void repaint3(long);
    public abstract void wait3();
    public abstract boolean contains2(int, int);
    public abstract void resize2(int, int);
    public abstract java.lang.String getName();
    public abstract void setName(java.lang.String);
    public abstract java.lang.Object getPeer();
    public abstract boolean keyDown(java.lang.Object, int);
    public abstract void notifyAll();
    public abstract void requestFocus();
    public abstract int getBackground();
    public abstract void setBackground(int);
    public abstract void dispatchEvent(java.lang.Object);
    public abstract void wait(long, int);
    public abstract void paint(java.lang.Object);
    public abstract java.lang.Object getParent();
    public abstract void repaint(long, int, int, int, int);
    public abstract int getImageCount();
    public abstract void setVisible(boolean);
    public abstract int getimageCount();
    public abstract void resize(java.lang.Object);
    public abstract java.lang.Object size();
    public abstract void show(boolean);
    public abstract void show2();
    public abstract long getDelay();
    public abstract void setDelay(long);

© 1997 by Scott Ladd. All rights reserved.