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!

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

Karthik Perath
Answer
You can write EL condition on visible(or show component property) of the Administration menu item: #{oimcontext.currentUser.roles['SYSTEM ADMINISTRATORS'] != null}

Check this link about writing EL's http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABHBFGH
Marked as Answer by 969408 · Sep 27 2020
969408
Thanks Karthik for you reply. It helped a lot.

Steps, just for reference...
1). Create SandBox
2). Activate
3). Customze and view by source
4). Select your link which you want to hide
5). Edit Visible properties and use #{oimcontext.currentUser.roles['SYSTEM ADMINISTRATORS'] != null}
6). Save
7). Publish
8). Test

Edited by: 966405 on Feb 20, 2013 3:50 PM
1 - 2
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,114 views