I Write a small program that will switch among number of L&F Just choose L&F from list and button will looks different.
but not change when Second chance
and I am beginner with java :)
this my code
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int selectedIndices[] = jList1.getSelectedIndices();
try {
for (int j = 0; j < selectedIndices.length; j++){
if(j == 0){
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
this.pack();
}
if(j == 1){
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(this);
this.pack();
}
if(j == 2){
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
// this.pack();
}
if(j == 3){
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
this.pack();
}
}
}
catch (Exception e) {
}
}