<Swing Dev> Java_Swings/AWT Native Interface give error in 32-bit window OS

mahendrag gajera mahendra.gajera at gmail.com
Tue Mar 7 05:50:02 UTC 2017


Hello All,

I follow step as mention in below link and create .dll and java application.

https://en.wikibooks.org/wiki/Java_Swings/AWT. Every things work fine in
window 7/8 64-bit OS.

In window7 32-bit OS, It work after below change in code.

*public class JavaSideCanvas extends Canvas {*

*    static {*
*        System.loadLibrary("jawt");*
*        System.loadLibrary("NativeSideCanvas");*
*    }*

*    public native void paint(Graphics g);*

*    public static void main(String[] args) {*
*        Frame frame = new Frame();*
*        frame.setBounds(0, 0, 500, 500);*
*        JavaSideCanvas jsc = new JavaSideCanvas();*
*        frame.add(jsc);*
*        frame.addWindowListener(new WindowAdapter() {*
*            public void windowClosing(WindowEvent ev) {*
*                System.exit(0);*
*            }*
*        });*
*        frame.show();*
*    }*
*}*
But it is not working in window8 32-bit OS.

I found the cause,* jawt.lib* is giving error. If i remove from linker
setting of my project,then it works fine

Can any one help me why it is not working in window8 32-OS only?.
or
Can i write own *JAWT_GetAWT *method for window? So no need to link
*jawt.lib.*

*Environment *
Project compiled in *jdk-7u55-windows-x86*.
Using 32 bit JRE 6/7/8 in window8 32-bit OS

Please look the attached code for the same.


Thanks in Advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170307/bf91ffef/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JavaBridgeFileLoader.java
Type: application/octet-stream
Size: 2041 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170307/bf91ffef/JavaBridgeFileLoader.java>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyCanvas.java
Type: application/octet-stream
Size: 798 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170307/bf91ffef/MyCanvas.java>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Canvas.zip
Type: application/zip
Size: 6619 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170307/bf91ffef/Canvas.zip>


More information about the swing-dev mailing list