
JME is the most popular molecule structure editor on the web. We can integrate it to any web pages or Java applications. Now, we’re going to integrate JME into .Net applications via IKVM.NET .
Although JME can be obtained at no cost, it’s still a private software as it’s not open source. Any port method at source code level would not work on JME. The only way is work with JME Java byte-code.
IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework.To be brief, IKVM.NET is a JVM for .Net. With IKVM.NET, we’re able to run Java byte-code on .Net Framework. IKVM.NET has uncomplete support for AWT and Swing.
With several simple steps listed below, you’re able to integrate JME into your VB.Net or C# applications.
Let’s have a look at how we can do it.
Under the directory of IKVM.NET executables, this command below can simply covert JME from Java byte-code into .Net IL code.
C:\ikvm-0.40.0.1\bin>ikvmc.exe -target:library JME.jar
Note IKVMC0002: output file is "JME.dll"
Add JME.dll and other IKVM.NET dependencies into your Visual Studio project as reference and then you can access JME class in C#.
JME applet = new JME();
JWindow floatingWindow = new JWindow();
floatingWindow.setSize(300, 300);
floatingWindow.setLayout(new GridLayout(1, 1));
floatingWindow.add(applet);
applet.init();
applet.start();
floatingWindow.setVisible(true);
With this code snippet you can display JME in C# applications and invoke the applet’s Java methods in C#.
Tags: .Net, Applet, C#, Chemoinformatics, JME
Nice work on this. I realize this is a terribly old post to reactivate but I was hopping you may be able to post your c# solution files for this. I have been frustrating myself terribly trying to use IKVM to run Processing applets inside of c#. Yours is the most complete example I have found to date and has gotten me the furthest so far but it is still not working. Thanks much in advance.
Cheers!
Strongly suggest adding a “google+” button for the blog!