package LAF;


public class LAF {
    public static final String Windows = "Windows";
    public static final String Mac = "Nimbus";
    public static final String Nimbus = "Nimbus";
    public static final String Motif = "Motif";
    public static final String Metal = "Metal";
    public static void LAFUpdate(java.awt.Component[] components){
        int NumberOfComponents = components.length;
        int i;
        for (i = 0; i<NumberOfComponents; i++){
            javax.swing.SwingUtilities.updateComponentTreeUI(components[i]);
        }

    }
    public static void LAFUpdate(java.awt.Component[] components, String lookAndFeel){
        if (lookAndFeel.equals("Windows")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Motif")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Nimbus")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Metal")){
            try {javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");}
            catch(Exception e){}
        }

        int NumberOfComponents = components.length;
        int i;
        for (i = 0; i<NumberOfComponents; i++){
            javax.swing.SwingUtilities.updateComponentTreeUI(components[i]);
        }
    }
    public static void LAFUpdate(java.awt.Component component, String lookAndFeel){
        if (lookAndFeel.equals("Windows")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Motif")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Nimbus")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Metal")){
            try {javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");}
            catch(Exception e){}
        }

        javax.swing.SwingUtilities.updateComponentTreeUI(component);
    }
    public static void setLAF(String lookAndFeel){
        if (lookAndFeel.equals("Windows")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Motif")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Nimbus")){
            try {javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");}
            catch(Exception e){}
        }
        if (lookAndFeel.equals("Metal")){
            try {javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");}
            catch(Exception e){}
        }
    }

}
