2011-05-01 91 views
3

我在Linux和Windows中使用了quaqua外觀。它工作得很好,直到我遇到了JOptionPane的問題。當代碼打開的JOptionPane使用線路Quaqua外觀和感覺問題

JOptionPane.showInternalConfirmDialog(
    pos_main.category_layer, "Give Rewards Now!!", "Loyalty", 1); 

我收到以下異常,

 
Warning: class ch.randelshofer.quaqua.osx.OSXApplication couldn't load library "quaqua". 
java.lang.UnsatisfiedLinkError: no quaqua in java.library.path 
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException 
    at org.netbeans.lib.awtextra.AbsoluteLayout.addLayoutComponent(Unknown Source) 
    at java.awt.Container.addImpl(Container.java:1074) 
    at java.awt.Container.add(Container.java:927) 
    at javax.swing.JOptionPane.createInternalFrame(JOptionPane.java:1541) 
    at javax.swing.JOptionPane.showInternalOptionDialog(JOptionPane.java:1259) 
    at javax.swing.JOptionPane.showInternalConfirmDialog(JOptionPane.java:1194) 
    at javax.swing.JOptionPane.showInternalConfirmDialog(JOptionPane.java:1155) 
    at javax.swing.JOptionPane.showInternalConfirmDialog(JOptionPane.java:1118) 
    at operator.pos_main.formWindowOpened(pos_main.java:254) 
    at operator.pos_main.access$000(pos_main.java:38) 
    at operator.pos_main$1.windowOpened(pos_main.java:79) 
    at java.awt.AWTEventMulticaster.windowOpened(AWTEventMulticaster.java:322) 
    at java.awt.Window.processWindowEvent(Window.java:1859) 
    at javax.swing.JFrame.processWindowEvent(JFrame.java:279) 
    at java.awt.Window.processEvent(Window.java:1820) 
    at java.awt.Component.dispatchEventImpl(Component.java:4630) 
    at java.awt.Container.dispatchEventImpl(Container.java:2099) 
    at java.awt.Window.dispatchEventImpl(Window.java:2475) 
    at java.awt.Component.dispatchEvent(Component.java:4460) 
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) 
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) 
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) 
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) 
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 

- 編輯 -

的System.out.println(System.getProperty(」的java.library.path「));顯示以下輸出。

C:\Program Files\Java\jdk1.6.0_15\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\DecisionStudio Professional\MySQL Server 5.0\bin;C:\Program Files (x86)\DecisionStudio Professional\R-Project\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\GmoteServer\bin\vlc

+0

@trashgod:檢查我的編輯.. – Deepak 2011-05-01 17:35:17

回答

2

看起來你需要通過步驟檢查Integration Into an Application

附錄:在Mac OS X上,/System/Library/Java是幾個系統屬性的根,如java.homejava.library.path。這是JOptionPane所需的資源所在地。 Linux和Windows是not supported

附錄:在Ubuntu 10.04上,JOptionPane演示運行正常;你可以使用這個approach,它僅適用於開發目的。

 
$ java -jar dist/quaqua-test.jar 
    CREATING LAF ch.randelshofer.quaqua.leopard.Quaqua15LeopardCrossPlatformLookAndFeel 
    LAF CREATED 
    SETTING LAF 
    LAF SET 
QuaquaTest EDT latency=203 
QuaquaTest laf create latency=69 
QuaquaTest set laf latency=46 
QuaquaTest create latency=406 
QuaquaTest total startup latency=819 
Warning: class ch.randelshofer.quaqua.osx.OSXApplication couldn't load library "quaqua". java.lang.UnsatisfiedLinkError: no quaqua in java.library.path 
user chose Continue 
+0

'包含在類路徑的目錄/系統/圖書館/ Java的,這是什麼意思嗎? – Deepak 2011-05-01 17:45:40

+2

有關開發目的,請參閱[this](http://mindprod.com/jgloss/laf.html)。我一般使用[http://www.virtualbox.org/](http://www.virtualbox.org/)代替。 – trashgod 2011-05-01 18:26:20

+0

這就是完美!使用這個我可以改變外觀和感覺..但可悲的是,quaqua不會允許我們把商業應用程序放在Linux平臺上:( – Deepak 2011-05-01 18:48:23