Nimbus Appearance Unavailable

I created a gui application in netbeans 7.2 in java. I created a JFrame there. it was configured on nimbus and looked in auto-generated code. but my frame is not like a halo.

so I debug the code and find that nimbus is not available in the array returned by getInstalledLookAndFeels() .

so what should i do to install nimbus? JDK 1.6 is used to compile code.

+4
source share
1 answer

Make sure your java version is larger than: JDK 6 10 Update.

Look here :

Nimbus is a polished cross-platform appearance introduced in Java SE 6 Update 10 (6u10) Released.

You can download the latest versions of Java (7u9) and Netbeans (7.2.1) (included) here:

After that you should be good to go, do not forget to install L & F from inside the Event Disptach Thread too:

  //Create UI and set L&F on EDT SwingUtilities.invokeLater(new Runnable( ) { public void run( ) { //set L&F try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (Exception e) { // If Nimbus is not available, you can set the GUI to another look and feel. e.printStackTrace(); } //create UI and components here } }); 
+6
source

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


All Articles