<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ChemHack &#187; .Net</title>
	<atom:link href="http://chemhack.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://chemhack.com</link>
	<description>Hacking the chemistry world.</description>
	<lastBuildDate>Sat, 18 Dec 2010 18:07:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JME on .Net Framework &#8211; A Workaround</title>
		<link>http://chemhack.com/2009/08/jme-on-net-framework-a-workaround/</link>
		<comments>http://chemhack.com/2009/08/jme-on-net-framework-a-workaround/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 06:55:59 +0000</pubDate>
		<dc:creator>Duan Lian</dc:creator>
				<category><![CDATA[Chemoinformatics]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Applet]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[JME]]></category>

		<guid isPermaLink="false">http://chemhack.com/?p=311</guid>
		<description><![CDATA[Introduction JME is the most popular molecule structure editor on the web. We can integrate it to any web pages or Java applications. Now, we&#8217;re going to integrate JME into .Net applications via IKVM.NET . Method Although JME can be obtained at no cost, it&#8217;s still a private software as it&#8217;s not open source. Any [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<h2><img class="alignright size-full wp-image-318" title="2" src="http://chemhack.com/wp-content/uploads/2009/08/21.png" alt="2" width="283" height="282" /></h2>
<p><a href="http://www.molinspiration.com/jme/" target="_blank">JME</a> is the most popular molecule structure editor on the web. We can integrate it to any web pages or Java applications. Now, we&#8217;re going to integrate JME into .Net applications via <a href="http://www.ikvm.net/" target="_blank">IKVM.NET </a>.</p>
<h2>Method</h2>
<p>Although JME can be obtained at no cost, it&#8217;s still a private software as it&#8217;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.</p>
<p>IKVM.NET is an implementation of Java for <a href="http://www.go-mono.org/" target="_blank">Mono</a> and the <a href="http://msdn.microsoft.com/netframework/" target="_blank">Microsoft .NET Framework</a>.To be brief, IKVM.NET is a JVM for .Net. With IKVM.NET, we&#8217;re able to run Java byte-code on .Net Framework. IKVM.NET has uncomplete support for AWT and Swing.</p>
<p>With several simple steps listed below, you&#8217;re able to integrate JME into your VB.Net or C# applications.</p>
<ol>
<li>Download IKVM.Net and compile JME.jar into .Net assembly.</li>
<li>Wrap JME applet into a Java Swing container JWindow.</li>
<li> Popup the JWindow.</li>
</ol>
<p>Let&#8217;s have a look at how we can do it.</p>
<h2>Compiling JME into .Net assembly</h2>
<p>Under the directory of IKVM.NET executables, this command below can simply covert JME from Java byte-code into .Net IL code.</p>
<pre lang="shell">C:\ikvm-0.40.0.1\bin&gt;ikvmc.exe -target:library JME.jar
Note IKVMC0002: output file is "JME.dll"</pre>
<p>Add JME.dll and other IKVM.NET dependencies into your Visual Studio project as reference and then you can access JME class in C#.</p>
<h2>Display JME</h2>
<pre lang="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);</pre>
<p>With this code snippet you can display JME in C# applications and invoke the applet&#8217;s Java methods in C#.</p>
]]></content:encoded>
			<wfw:commentRss>http://chemhack.com/2009/08/jme-on-net-framework-a-workaround/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

