Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Patch for SWT_AWT

I see you're using System.loadLibrary to load SWT_AWT.dll. Did you test using

   System.loadLibrary ("jawt");

to load jawt? You can load any native shared library with System.loadLibrary. You shouldn't have to resort to C for that.

-- Leonard

Di Iorio, Matthew (ISS Atlanta) wrote:

I have tested with JDK 1.3 and 1.4 and Windows 2000. All of the knowledge/code was taken from the following page, which is included in the JDK 1.3 docs:

http://java.sun.com/j2se/1.3/docs/guide/awt/AWT_Native_Interface.htm l <http://java.sun.com/j2se/1.3/docs/guide/awt/AWT_Native_Interface.html>


The code only works with Windows because (a) I don't know to o much about X and (b) I don't have Linux installed anywhere. It shouldn't be too hard to port to X if there is a way to create a Shell from a Drawable(?).

The only quirk with the code is the part that loads jawt.dll (the loadJawtLibrary function). During testing I found that the code failed to load jawt.dll when the code was run using the invo cation API. When I ran the code with java.exe it worked fine. I'm not sure if it's something that I am doing wrong, but I haven't figured out a way around it.

Matt






Back to the top