Activex from java application?

后端 未结 3 1045
时光取名叫无心
时光取名叫无心 2021-02-06 11:04

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 e

3条回答
  •  礼貌的吻别
    2021-02-06 12:03

    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.

提交回复
热议问题