Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swing setLookAndFeel和NullPointerException_Swing_Clojure - Fatal编程技术网

Swing setLookAndFeel和NullPointerException

Swing setLookAndFeel和NullPointerException,swing,clojure,Swing,Clojure,有没有人试图改变swing的外观和感觉?这段代码取自一个示例,只会生成一个空指针异常,我想知道可能有什么问题: (javax.swing.UIManager/setLookAndFeel (javax.swing.UIManager/getSystemLookAndFeelClassName)) (javax.swing.UIManager/setLookAndFeel (javax.swing.UIManager/getSystemLookAndFeelClassName)) 谢谢 试试

有没有人试图改变swing的外观和感觉?这段代码取自一个示例,只会生成一个空指针异常,我想知道可能有什么问题:

(javax.swing.UIManager/setLookAndFeel (javax.swing.UIManager/getSystemLookAndFeelClassName)) (javax.swing.UIManager/setLookAndFeel (javax.swing.UIManager/getSystemLookAndFeelClassName)) 谢谢

试试这个:

(prn "LAFs:" (map #(.toString %) 
  (javax.swing.UIManager/getInstalledLookAndFeels)))
获取已安装L&F的列表;然后你可以亲手挑选一个你喜欢的


这不是一个完整的解决方案(我同意Brian的观点,您的代码应该可以简单地工作™) 但这至少应该给你一些选择。

在这里起作用。
(javax.swing.UIManager/getSystemLookAndFeelClassName)
返回什么?它返回“javax.swing.plaf.metal.MetalLookAndFeel”NPE几乎肯定来自其他地方。公共静态void setLookAndFeel(字符串类名)抛出ClassNotFoundException、InstanceionException、IllegalAccessException、UnsupportedLookandFeelexException您是否按照上面从一个新的REPL运行此示例?唯一的建议是列出您的JRE细节。