Cal-cium
Cal-cium

Reputation: 654

Can't get Darkula to work in look and feel in Netbeans

The problem I'm having is I've installed the Darkula plugin into Netbeans. This has changed the editor the way it should do. I have set it as preferred look and feel but when running the application it doesn't use Darkula theme only nimbus. I can only get it to use Nimbus or Windows.

In the below code I have changed Nimbus to say Darkula and it doesn't work.

try{
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if ("Darkula".equals(info.getName())) {
              javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
           }
        }     

       //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch(ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException ex){
            System.out.println(ex.toString());                        
        }       

Upvotes: 0

Views: 602

Answers (1)

Sergiy Medvynskyy
Sergiy Medvynskyy

Reputation: 11327

The method UIManager.getInstalledLookAndFeels() will only return system known L&F. If you have an external L&F you need to call it by the class name. For your case:

UIManager.setLookAndFeel(new DraculaLaf());

or

UIManager.setLookAndFeel(DraculaLaf.class.getName());

Upvotes: 2

Related Questions