Changing Look and Feel

I finally figured out how to change the look and feel of an application, but now I'm trying to figure out how the user can change it during run time. I was thinking that when the user chooses a "look" the program could just reload and send the lookAndFeel (such ascom.sun.java.swing.plaf.windows.WindowsLookAndFeel) to the main's arguments, but I'm not sure how I could do this exactly... any push in the right direction would be great.. thanks.

[463 byte] By [bl4ckprinta] at [2007-11-26 13:49:04]
# 1
http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html
es5f2000a at 2007-7-8 1:25:23 > top of Java-index,Java Essentials,Java Programming...
# 2

thanks! I tried using the SwingUtilities.updateComponentTreeUI method, and it worked for the most part, but for some reason now when I use this code:

try {

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

SwingUtilities.updateComponentTreeUI(this);

pack();

}

catch (Exception e) {

}

The frame seems to turn into a JWindow... as in the title bar disappears.... I'm not sure why it's doing that...

bl4ckprinta at 2007-7-8 1:25:23 > top of Java-index,Java Essentials,Java Programming...
# 3
Hm, that's most odd. Can you post a SSCCE?
es5f2000a at 2007-7-8 1:25:23 > top of Java-index,Java Essentials,Java Programming...
# 4
Ah nevermind I figured it out. It's just becuase by default I was using JFrame.setDefaultLookAndFeelDecorated(true); -- Thanks for your help though!
bl4ckprinta at 2007-7-8 1:25:23 > top of Java-index,Java Essentials,Java Programming...