Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

trying to put java awt into c# app

843807Aug 10 2010
Hi, not sure if this is the place to post, mod please move it necessary...
The problem here is that i am trying to put a java panel into a C# winform.
I am using the IKVM to convert my java class to a dll and the C# program is referencing it.

Here are the codes:
for java:
// JavaComponent.java
import java.awt.*;
import java.awt.event.*;

public class JavaComponent extends Panel {
   public TextField javaTextBox;
   Button btn;

   public JavaComponent() {
      setSize(400, 100);
      setLayout(new GridLayout());
      add(new Label("JavaComponent: ");
      javaTextBox = new TextField(30);
      btn = new Button("Send");
      add(javaTextBox);
      add(btn);
   }

   public void addActionListener(ActionListener l)
{
   btn.addActionListener()l;
}
}
For C#
JavaComponent jc = new JavaComponent();
jc.setVisible(true);
The C# program compiles without errors but when runing up, it does not show the awt and gives an error of java.Lang.ClassNotFoundException occured in IKVM.Runtime.dll,
System.IO.DirectoryNotFoundException in mscorlib.dll
java.Lang.ClassNotFoundException occured in IKVM.OpenJDK.Core.dll

Can anyone help?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 7 2010
Added on Aug 10 2010
0 comments
1,096 views