Posted By:
Alexander_Krapf
Posted On:
Tuesday, July 23, 2002 05:01 PM
Dinesh,
Check out JunC++ion at www.codemesh.com. JunC++ion generates C++ proxy classes for compiled Java classes. Among other features, you can implement interfaces or extend adapters in C++ and register the instances with a Java event source. A reallife example might look like:
class MyActionListener : public ActionListenerCB
{
public:
MyActionListener() : ActionListenerCB( _use_java_ctor )
{
}
void actionPerformed( const ActionEvent & _evt )
{
cout << _evt.toString() << endl;
}
};
and you would use it like
myButton.addActionListener( MyActionListener() );
It's a very natural and highly usable C++ interface. It does not get much simpler.
Regards,
Alex