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#.