JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java & XML、Web Service  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁
smartdanny





發文: 598
積分: 1
於 2013-06-02 20:50 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
各位大大小弟想使用DJ Native Swing 套件的JWebBrowser功能來做瀏覽網頁的功能,
但是小弟遇到了幾個問題
我呼叫JWebBrowser的code如下
1
2
3
4
5
6
7
8
9
10
11
12
NativeInterface.open();
 
final JWebBrowser webBrowser = new JWebBrowser(JWebBrowser.destroyOnFinalization(), JWebBrowser.proxyComponentHierarchy());
webBrowser.setMenuBarVisible(false);
webBrowser.setButtonBarVisible(false);
webBrowser.setLocationBarVisible(false);
webBrowser.navigate("www.google.com.tw");
JFrame frame = new JFrame();
frame.setSize(800, 600);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.getContentPane().add(webBrowser);
frame.setVisible(true);*/ 

1.當我把程式寫好包成Applet的jar檔在jre1.7.0_21上run之後,在java console上出現下面的錯誤
1
2
Under WebStart on Java >= 1.6.0_18, the value of the "sun.awt.disableMixing" system property needs to be defined in the JNLP descriptor with value "true" (or "false" if you really want the default behavior). When not set to "true", the content of the native components may not be displayed.
NativeSwing[1]: Exception in thread "Thread-0" java.lang.NoClassDefFoundError: chrriis/dj/nativeswing/swtimpl/core/SWTNativeInterface$4

2.我就造錯誤上的方式使用JNLP把sun.awt.disableMixing設為true,也一並使用JNLP來呼叫我的Applet程式,JNLP內容如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for DJNativeSwing -->
<jnlp spec="1.0+"
  codebase="http://192.168.17.124"
  href="DJN.jnlp">
  <information>
    <title>Danny JNLP TEST</title>
    <vendor>Big Danny</vendor>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <property name="jnlp.packEnabled" value="true" />
    <property name="sun.awt.disableMixing" value="true" />
    <!-- Application Resources -->
    <j2se version="1.6+" 
       href="http://java.sun.com/products/autodl/j2se" />
    <jar href="AppletCNM.jar" main="true" />
  </resources>
  <applet-desc 
    name="L7 Applet"
    main-class="cnm.AppletCNM"
    width="300"
    height="300">
  </applet-desc>
  <update check="background"/>
</jnlp>

inex.html內容如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Big5">
<title>
Management Console
</title>
</head>
<body background="image/company/index_01.jpg" style="background-repeat:no-repeat">
<applet jnlp_href="DJN.jnlp" 
  width="0" 
  height="0">
</applet>
</body>
</html>

但是程式又發生NoClassDefFoundError的Exception如下
1
2
3
4
5
6
7
8
9
NativeSwing[1]: Exception in thread "Thread-0" java.lang.NoClassDefFoundError: chrriis/dj/nativeswing/swtimpl/core/SWTNativeInterface$4
NativeSwing[1]:   at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.destroyControls(SWTNativeInterface.java:1320)
NativeSwing[1]:   at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.access$4(SWTNativeInterface.java:1317)
NativeSwing[1]:   at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess$4.run(SWTNativeInterface.java:1171)
NativeSwing[1]: Caused by: java.lang.ClassNotFoundException: chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$4
NativeSwing[1]:   at chrriis.common.NetworkURLClassLoader.findClass(NetworkURLClassLoader.java:77)
NativeSwing[1]:   at java.lang.ClassLoader.loadClass(Unknown Source)
NativeSwing[1]:   at java.lang.ClassLoader.loadClass(Unknown Source)
NativeSwing[1]:   ... 3 more

我已經將DJ Native Swing套件都包在我的Applet jar檔裡面了,為什麼還找不到該class,我該怎麼做,請各位高手幫幫忙


smartdanny edited on 2013-06-02 20:52
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2013-06-03 23:06 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我發現如果jre1.7.0_21就會發生class not found的問題
jre1.6.0_21就不會發生class not found的問題!!
這是我我下載的版本太舊的原因嗎?
我下載的版本是DJNativeSwing-SWT-1-0-2-2-120308.zip
http://sourceforge.net/projects/djproject/


reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
yahoo1234tw





發文: 668
積分: 0
於 2013-06-04 08:21 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
smartdanny wrote:
我發現如果jre1.7.0_21就會發生class not found的問題
jre1.6.0_21就不會發生class not found的問題!!
這是我我下載的版本太舊的原因嗎?

那把JRE換掉就好啦。


reply to postreply to post
專業的職業演員不會站在路邊演白戲,但是這裡有很多以寫程式為業的人很喜歡作賤自己跟別人,沒事就免費幫一些懶學生寫作業。
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2013-07-03 10:56 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
TEST

新增文字文件.txt (45.04k)


reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2013-10-17 10:19 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
hi post test

smartdanny edited on 2013-12-27 15:34
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2013-12-12 15:47 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
post test + file

skype.sql (10.31k)


smartdanny edited on 2013-12-26 16:59
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2013-12-13 13:10 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
post test2

reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2013-12-27 15:36 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
hi post test 2

cn.html (12.81k)


smartdanny edited on 2014-08-20 15:12
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2014-11-11 12:14 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
post test 8

新增文字文件 (2).txt (0.01k)


smartdanny edited on 2014-11-25 10:39
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2014-11-24 14:37 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
id test 3

新增文字文件 (2).txt (0.05k)


smartdanny edited on 2014-11-25 13:50
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
作者 Re:該如何使用JNLP讓Applet運行在jre1.6+ 並能使用DJ Native Swing套件的JWebBrowser瀏覽網頁 [Re:smartdanny]
smartdanny





發文: 598
積分: 1
於 2016-06-15 03:18 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Hi test test test

123.txt (0.01k)


smartdanny edited on 2016-06-15 03:22
reply to postreply to post
我是API 白癡!! 重新學習GOGO!!
» JWorld@TW »  Java & XML、Web Service

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8