SetLookAndFeel and NullPointerException

Has anyone ever tried to change the look of a swing? This code, taken from the example, just gives a null pointer exception, and I wonder what might be wrong:

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

Thank!

+3
source share
1 answer

Try the following:

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

to get a list of installed L & Fs; then you can choose one of them that you like.

Not a complete solution (I agree with Brian that your code should just work and trade;), but that should at least give you some options.

+3
source

Source: https://habr.com/ru/post/1725106/


All Articles