集成的Java与C#.NETJava、NET

2023-09-07 00:55:11 作者:姐、专属的范

时以下可能的事情吗?如果是的话怎么样? 我有一些已经在java.Now实现核心functionily我想创建一个图形用户界面,。 我发现很难用swing.I可以用C#.net轻松地构建一个GUI进行图形用户界面在Java中。 所以我想,如果有可能在Java中创建一个图书馆,我可以访问我的FRM的C#code。 矮个子:我的Java code会提供一些​​API,然后我的C#程序muct能够调用这些API

Is following thing possible?if yes how? I have some core functionily already implemented in java.Now i want to create a GUI for it. I am finding it difficult to make a GUI in java using swing.I can build a GUI easily in C#.net. So i was thinking if it was possible to create a library in java that i can access frm my C# code. Shorty: my java code will provide some api and then my C# program muct be able to call those apis.

如何做到这一点?

推荐答案

取决于你的Java库做,如果它使用了很多第三方组件,但由于的 IKVM 你可以编译一个jar文件转换成.NET程序集。我用这个方法,以纳入 xhtmlrenderer Java库成C#应用程序的成功。

Depends on what your java library does and if it uses many third party components, but thanks to IKVM you could compile a jar file into a .NET assembly. I've used this approach to incorporate the xhtmlrenderer java library into a C# application with success.