2

I want to try out the scores of look and feels easily.

I made an app with a JList that lists installed Look and Feels using

UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();

and it sets the selected look and feel using

UIManager.setLookAndFeel(lafInfo[i].getClassName()); SwingUtilities.updateComponentTreeUI(owner);

owner.pack();

However the Java\jdk1.7.0_11\jre\lib\ext\seaglasslookandfeel-0.2.jar is not listed!

How do you install all looks and feel INSIDE the Java system so that it is returned by UIManager.getInstalledLookAndFeels(); ?

EDIT: Right now I'm using this hack. But I don't like it because it is not pluggable. For every single LaF, I run this code at the start of the application

 try {
     String look = "com.seaglasslookandfeel.SeaGlassLookAndFeel";
     Class.forName(look);
     UIManager.installLookAndFeel("Sea Glass", look);
  }catch (ClassNotFoundException e) {
  }
Mordan
  • 337
  • 3
  • 12
  • Can you try this [example](http://stackoverflow.com/a/11949899/230513)? – trashgod Jul 30 '13 at 16:09
  • 1
    thx for the link. it was helpful but not in answering my question. here my issue 1) how do you install 20+ new Lafs without modifying any of your code – Mordan Jul 30 '13 at 18:34

0 Answers0