Seguinte galera fiz uma Classe e um menu pra alterar o LookAndFeel da minha aplicação. Classe é seguinte:
[code]package Visao;
import javax.swing.JFrame;
/**
*
-
@author SUPORTE
*/
public class LookAndFeel {private javax.swing.UIManager.LookAndFeelInfo looks[];
private final int Metal = 0;
private final int Motif = 1;
private final int SO = 2;
private final int Windows = 3;
private final String Substance = “org.jvnet.substance.skin.SubstanceOfficeSilver2007LookAndFeel”;public LookAndFeel() {
}public void setLookAndFeelPadrao(int index, JFrame frame) {
looks = javax.swing.UIManager.getInstalledLookAndFeels();
try {
javax.swing.UIManager.setLookAndFeel(looks[index].getClassName());
javax.swing.SwingUtilities.updateComponentTreeUI(frame);
} catch (Exception e) {
e.printStackTrace();
}
}public void setLookAndFeelSubstance(String parametro, JFrame frame) {
looks = javax.swing.UIManager.getInstalledLookAndFeels();
try {
javax.swing.UIManager.setLookAndFeel(parametro);
javax.swing.SwingUtilities.updateComponentTreeUI(frame);
} catch (Exception e) {
e.printStackTrace();
}
}public int getMotif() {
return Motif;
}public int getWindows() {
return Windows;
}public int getMetal() {
return Metal;
}public int getSo() {
return SO;
}public String getSubstance() {
return Substance;
}
[/code]
O probelma é o seguinte não consegui encontar uma maneira de atualizar todas as telas quando aciono o evento de botão que muda o LookAndFeel utilizo para as telas JFrame e JDialogs. creio que tenho atualizar os componetes da tela toda vez que chama-las. mas tbm não consegui !