我在我的Java Swing應用程序中使用物質外觀和感覺版本6.0。該應用程序工作正常,我,但一些應用程序的用戶尤其是那些使用Windows 7越來越物質的異常:Java物質 - 奇怪的例外
java.lang.InternalError: Unable to instantiate org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser.ColorPalettesChooser
at org.pushingpixels.substance.internal.ui.SubstanceColorChooserUI.createDefaultChoosers(SubstanceColorChooserUI.java)
at org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.Quaqua13ColorChooserUI.__org__pushingpixels__substance__internal__contrib__randelshofer__quaqua__Quaqua13ColorChooserUI__installUI(Quaqua13ColorChooserUI.java)
at org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.Quaqua13ColorChooserUI.installUI(Quaqua13ColorChooserUI.java)
at org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.Quaqua14ColorChooserUI.__org__pushingpixels__substance__internal__contrib__randelshofer__quaqua__Quaqua14ColorChooserUI__installUI(Quaqua14ColorChooserUI.java)
at org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.Quaqua14ColorChooserUI.installUI(Quaqua14ColorChooserUI.java)
at org.pushingpixels.substance.internal.ui.SubstanceColorChooserUI.__org__pushingpixels__substance__internal__ui__SubstanceColorChooserUI__installUI(SubstanceColorChooserUI.java)
at org.pushingpixels.substance.internal.ui.SubstanceColorChooserUI.installUI(SubstanceColorChooserUI.java)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JColorChooser.setUI(Unknown Source)
at javax.swing.JColorChooser.updateUI(Unknown Source)
at javax.swing.JColorChooser.(Unknown Source)
at javax.swing.JColorChooser.(Unknown Source)
at javax.swing.JColorChooser.(Unknown Source)
at org.jdesktop.swingx.JXColorSelectionButton.getChooser(JXColorSelectionButton.java)
at org.jdesktop.swingx.JXColorSelectionButton$1.propertyChange(JXColorSelectionButton.java)
at java.beans.PropertyChangeSupport.fire(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at java.awt.Component.setBackground(Unknown Source)
at javax.swing.JComponent.setBackground(Unknown Source)
在此代碼的最後一行出現此異常:
JXColorSelectionButton myColorSelectionButton = new JXColorSelectionButton();
myColorSelectionButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
myColorSelectionButton.setFocusPainted(false);
contentPane.add(myColorSelectionButton, cc.xy(29, 19));
/**
* Some code here
*/
myColorSelectionButton.setBackground(Color.WHITE); // Excepton occurres here !!
我找不到地方問這個物質問題,所以如果你能幫助我,那將不勝感激。
的異常在[Methods.java]拋出(http://java.net/projects/quaqua/sources /svn/content/trunk/Quaqua/src/ch/randelshofer/quaqua/util/Methods.java?rev=442)上的newInstance方法。 – denolk
http://stackoverflow.com/questions/3954616/look-and-feel-in-java – mKorbel