Here you can find the source of setComponentLF(JComponent comp, String ui)
public static boolean setComponentLF(JComponent comp, String ui)
//package com.java2s; //License from project: LGPL import javax.swing.*; public class Main { public static boolean setComponentLF(JComponent comp, String ui) { LookAndFeel previousLF = UIManager.getLookAndFeel(); try {/* w ww . j ava2 s . com*/ for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (ui.equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } comp.updateUI(); UIManager.setLookAndFeel(previousLF); } catch (Exception e) { return false; } return true; } }