Ask about calling from C# to Java method

92 views
Skip to first unread message

Cam Hoang Truc

unread,
Feb 28, 2012, 4:00:45 AM2/28/12
to jni...@googlegroups.com

Hi Everyone,
In my C# project, I got the jTextField1 object in the NewJFrame.java of JavaApplication1.jar. Then I passed this jTextField1 to the Java method named "MyMethod" as a parameter. But the code addKeyListener in "MyMethod" caused an exception "javax.swing.JTextField.addKeyListener(Ljava/awt/event/KeyListener;)V" when I tried to invoke "MyMethod" in C#.
These are my projects:
C#: www.mediafire.com/?3hhgh17i9yn035g
Java: http://www.mediafire.com/?4fpy8mck454tp1m

By the way, tell me how to use a dll file in java application like the way I did in my C# project.

Please help me.
Thanks in advance.


Pavel Šavara

unread,
Feb 28, 2012, 5:16:32 PM2/28/12
to jni...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages