2

I am working with the NetBeans 6.5 IDE.

I downloaded a look and feel jar file and added it NetBeans by palette manager.

How do I use it in my application?

canolucas
  • 1,482
  • 1
  • 15
  • 32
Samurai
  • 843
  • 6
  • 23
  • 44

2 Answers2

3

You can follow this Sun tutorial about setting the L&F in Java

You can change the L&F with setLookAndFeel even after the program's GUI is visible.
To make existing components reflect the new L&F, invoke the SwingUtilities updateComponentTreeUI method once per top-level container.
Then you might wish to resize each top-level container to reflect the new sizes of its contained components. For example:

UIManager.setLookAndFeel(lnfName);
SwingUtilities.updateComponentTreeUI(frame);
frame.pack();
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for your reply. How to get InfName for a look and feel. We have windows classic ( I am using windows OS) theme in NetBeans. whats the InfName for that. – Samurai Mar 15 '10 at 05:29
2

Thanks for your reply. By using the below code we can get all look and feel class names.

UIManager.LookAndFeelInfo[] lookAndFeelInfos = UIManager.getInstalledLookAndFeels();
    for (int i = 0; i < lookAndFeelInfos.length; i++) {
        UIManager.LookAndFeelInfo lookAndFeelInfo = lookAndFeelInfos[i];

        //
        // Get the name of the look and feel
        //
        String name = lookAndFeelInfo.getName();
        System.out.println("name = " + name);

        //
        // Get the implementation class for the look and feel
        //
        String className = lookAndFeelInfo.getClassName();
        System.out.println("className = " + className);
    }
Samurai
  • 843
  • 6
  • 23
  • 44