gpt4 book ai didi

Java 物质 - 奇怪的异常

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:33:03 25 4
gpt4 key购买 nike

我在我的 Java Swing 应用程序中使用 Substance 外观版本 6.0。该应用程序对我来说工作正常,但一些应用程序用户,尤其是那些使用 Windows 7 的用户遇到了实质性异常:

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 !!

我找不到问这个 Substance 问题的地方,所以如果你能帮助我,我将不胜感激。

最佳答案

物质不再更新并且在 Java 7 上被破坏。

但是有人通过 fork 并称其为 insubstance 来备份该项目:http://shemnon.com/speling/

它支持 Java 7,并且似乎有下一次更新的宏伟计划。

它应该像交换库一样简单,让它在您的项目中工作。

关于Java 物质 - 奇怪的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7427048/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com