千里冰封
          JAVA 濃香四溢
          posts - 151,comments - 2801,trackbacks - 0
          前幾天寫了一個(gè)如何寫JNI的文章,說的是調(diào)用本地方法,昨天在ruislan的博客里面看到了他寫的一個(gè)關(guān)于窗體的透明和變換的,里面提到了JNA,然后我去JNA的網(wǎng)站一看,呵呵,還真不錯(cuò),它不但可以做到窗體的透明和變換,還可以完全調(diào)用本地的動(dòng)態(tài)鏈接庫文件,并且還在一定的程度上跨了平臺(tái)。

          以下是官方網(wǎng)站的介紹:https://jna.dev.java.net

          Java Native Access (JNA)

          JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.

          JNA's design aims to provide native access in a natural way with a minimum of effort. No boilerplate or generated code is required. While some attention is paid to performance, correctness and ease of use take priority.

          The JNA library uses a small native library stub to dynamically invoke native code. The developer uses a Java interface to describe functions and structures in the target native library. This makes it quite easy to take advantage of native platform features without incurring the high overhead of configuring and building JNI code (overhead would otherwise increase with each supported platform).

          The JavaDoc is available online, which includes an overview of specific usage.

          NOTE: Sun is not sponsoring this project, even though the package name (com.sun.jna) might imply otherwise.

          This library is provided under the LGPL, version 2.1 or later.

           


          以后只要系統(tǒng)上有的動(dòng)態(tài)鏈接庫,就可以直接調(diào)用了,再也不用定義本地方法,然后生成頭文件,然后去實(shí)現(xiàn)了。這么好的工具,怎么能不去研究一下呢,研究的過程中,我會(huì)把它寫成文章,與大家分享:)






          盡管千里冰封
          依然擁有晴空

          你我共同品味JAVA的濃香.
          posted on 2007-10-24 09:37 千里冰封 閱讀(6346) 評(píng)論(4)  編輯  收藏 所屬分類: JAVA擴(kuò)展

          FeedBack:
          # re: JNA介紹
          2007-10-25 08:55 | 阿蜜果
          官方網(wǎng)站的介紹的那部分字體好刺眼啊,呵呵
          關(guān)注起JNA來了。。。  回復(fù)  更多評(píng)論
            
          # re: JNA介紹
          2007-10-25 09:06 | 千里冰封
          呵呵,怎么變成這樣了,在FF下面看到不是這樣子的啊  回復(fù)  更多評(píng)論
            
          # re: JNA介紹
          2007-11-27 20:34 | 隔葉黃鶯
          我研究并寫過兩篇 JNative 調(diào)用動(dòng)態(tài)庫的日志,也是能跨平臺(tái)的。直接調(diào)用,不用寫自己的動(dòng)態(tài)庫。有時(shí)間也研究一下JNA,希望能與樓主共勉。  回復(fù)  更多評(píng)論
            
          # re: JNA介紹
          2008-04-05 13:33 | fenixshadow
          支持支持,jni根本不敢用,太麻煩了。

          還不如在java中把腳本寫死:vb\perl等,然后直接調(diào)用。

          咱也看看jna,希望好用  回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 都安| 蒲江县| 西昌市| 安吉县| 广昌县| 吕梁市| 宜昌市| 丰城市| 北京市| 沂水县| 达日县| 五寨县| 乐亭县| 图们市| 郴州市| 鄢陵县| 孟州市| 泰来县| 辛集市| 蓝田县| 洛阳市| 张家口市| 五原县| 叶城县| 祁东县| 象山县| 临潭县| 富锦市| 大理市| 汾西县| 慈利县| 安新县| 娄底市| 类乌齐县| 辽阳县| 肥城市| 福海县| 安国市| 枣强县| 棋牌| 高清|