// System.setProperty("Quaqua.tabLayoutPolicy", "wrap");
try {
LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels();
menusLnF = new JCheckBoxMenuItem[installedLookAndFeels.length];
for (int i = 0; i < installedLookAndFeels.length; i++) {
LookAndFeelInfo info = installedLookAndFeels[i];
final JCheckBoxMenuItem jCheckBoxMenuItem = new JCheckBoxMenuItem(info.getName());
jCheckBoxMenuItem.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
try {
LookAndFeelInfo findLookAndFeel = findLookAndFeel(jCheckBoxMenuItem.getText());
if (UIManager.getLookAndFeel().getName().contains(jCheckBoxMenuItem.getText())
|| UIManager.getLookAndFeel().getID().contains(jCheckBoxMenuItem.getText())
|| UIManager.getLookAndFeel().getClass().getName().equals(findLookAndFeel.getClassName())) {
return;
}
setLookAndFeel(findLookAndFeel);
for (JCheckBoxMenuItem menuItem : menusLnF) {
if (menuItem != jCheckBoxMenuItem && menuItem.isSelected()) {
menuItem.setSelected(false);
}
}
updateTelasLookAndFeel();
} catch (Exception ex) {
Logger.getLogger(Carregador.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
});
menusLnF[i] = jCheckBoxMenuItem;
}
String lnfSalvo = Configuracoes.LOOK_AND_FEEL.getValor();
// UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
boolean achou = false;
if (lnfSalvo != null && !lnfSalvo.isEmpty()) {
LookAndFeelInfo findLookAndFeel = findLookAndFeel(lnfSalvo);
if (findLookAndFeel != null) {
achou = true;
setLookAndFeel(findLookAndFeel);
} else {
achou = false;
}
}
if (!achou) {
String[] lnfPreferido = {"nimbus", "gtk+"};
for (String nome : lnfPreferido) {
LookAndFeelInfo lookAndFeelInfo = findLookAndFeel(nome);
if (lookAndFeelInfo != null) {
setLookAndFeel(lookAndFeelInfo);
// UIDefaults defaults = UIManager.getLookAndFeel().getDefaults();
//
// for (Map.Entry<Object, Object> entry : defaults.entrySet()) {