开发者

setLookAndFeel and NullPointerException

开发者 https://www.devze.com 2022-12-13 09:58 出处:网络
Has anyone ever tried to change swing\'s look and feel? Th开发者_JAVA技巧is code, taken from an example, simply yields a null pointer exception, and I wonder what might be wrong:

Has anyone ever tried to change swing's look and feel? Th开发者_JAVA技巧is code, taken from an example, simply yields a null pointer exception, and I wonder what might be wrong:

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

Thanks!


Try this:

(prn "LAFs:" (map #(.toString %) 
  (javax.swing.UIManager/getInstalledLookAndFeels)))

to get a list of installed L&Fs; then you can hand-pick one you like.

Not a complete solution (I agree with Brian that your code Should Simply Work™) but this should at least give you some options.

0

精彩评论

暂无评论...
验证码 换一张
取 消