Activex from java application?

Is it easy to embed ActiveX controls in a Java application? Is it worth it. In my next project, I should either use the existing activex in the Java application, or redo everything from scratch, so I'm curious that there will be less hassle.

+6
java windows activex
source share
3 answers

I don’t think there is a way to do this without resorting to a third-party library. (Or roll your own, but you said easy.)

SWT (Standard Widget Set) contains support for embedding ActiveX controls. SWT is an alternative to Swing, although there is a degree of compatibility between them.
Here is an example of embedding Windows Media Player in a SWT window.

An alternative is the Jacob project, although I myself have not used it.

As for "is it worth it?" What can I say from experience that SWT makes this relatively easy, but if your application cannot gracefully not have them available by relying on COM components, you lose the ability to work on multiple platforms, which makes Java attractive in first of all.

+10
source share

It really depends on how much you have to redo. the Jacob project is not bad (we use it extensively to automate Excel and Word), but you really need to understand COM to use it, especially the vagaries of the IDispatch interface (very few people who use ActiveX / COM really understand COM - they just rely on creating Microsoft templates).

If you're just trying to save yourself some simple DAO objects, you are probably better off reprogramming (hell, you could probably take a DTD and write a script to generate Java code for it).

+4
source share

http://www.codeproject.com/KB/cross-platform/javacom.aspx?msg=1776281 can help if you are willing to do things manually ...

Not like flexibility though ...

+1
source share

All Articles