Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activex from java application?

Is it possible to easily embed ActiveX controls in Java application? Is it worth it. In my next project I should either use existing activex in Java app or have to reimplement everything from scratch, so I'm wondering what will be less hassle.

like image 291
Marko Avatar asked Oct 27 '08 09:10

Marko


People also ask

Does Java use ActiveX?

Technically, ActiveX refers to a software component written in a language like Visual Basic, C++, or Java that conforms to a specific Microsoft API.

What is ActiveX control in Java?

ActiveX controls are component program objects that Microsoft developed to enable applications to perform specific functions, such as displaying a calendar or playing a video. An ActiveX control is a small program that other applications can reuse to enable the same functionality, without the extra development work.

Can ActiveX run on any platform?

In principle, ActiveX is not dependent on Microsoft Windows operating systems, but in practice, most ActiveX controls only run on Windows.


1 Answers

I don't think there's a way to do this without resorting to a third party library. (Or rolling your own, but you did say "easily".)

SWT (The "Standard Widget Toolkit") contains support for embedding ActiveX controls. SWT is an alternative to Swing, though there is a degree of interoperability between them.
Here's an example of embedding Windows Media Player in an SWT window.

Alternatively there's the Jacob project, though I haven't used that myself.

As for "is it worth it?" Well, I can say from experience that SWT makes it relatively easy, but unless your application can gracefully deal with not having them available, by relying on COM components you are losing the ability to run on multiple platforms that makes Java attractive in the first place.

like image 162
alexmcchessers Avatar answered Sep 30 '22 21:09

alexmcchessers