1 19 package org.openharmonise.him.configuration.lnf; 20 21 import java.io.*; 22 23 import javax.swing.*; 24 25 import org.openharmonise.him.configuration.*; 26 import org.openharmonise.him.window.*; 27 28 import com.l2fprod.gui.plaf.skin.*; 29 30 37 public class ConfigSkinLnF extends ConfigLnF { 38 39 42 private ConfigDialog m_dialog = null; 43 44 47 private String m_sTheme = null; 48 49 55 public ConfigSkinLnF(String sTheme, ConfigDialog dialog) { 56 super(); 57 this.m_dialog = dialog; 58 this.m_sTheme = sTheme; 59 } 60 61 64 public void setLookAndFeel() { 65 Skin skin = null; 66 try { 67 68 InputStream is = ConfigSkinLnF.class.getResourceAsStream(m_sTheme); 69 70 skin = SkinLookAndFeel.loadThemePack( is ); 71 72 SkinLookAndFeel.setSkin(skin); 73 SkinLookAndFeel.enable(); 74 75 String lookAndFeelClassName = "com.l2fprod.gui.plaf.skin.SkinLookAndFeel"; 76 77 UIManager.setLookAndFeel(lookAndFeelClassName); 78 79 JFrame frame = DisplayManager.getInstance().getMainWindow(); 80 81 if(frame!=null) { 82 SwingUtilities.updateComponentTreeUI(frame); 83 } 84 85 if(this.m_dialog!=null) { 86 SwingUtilities.updateComponentTreeUI(this.m_dialog); 87 } 88 } catch (UnsupportedLookAndFeelException e) { 89 e.printStackTrace(); 90 } catch (ClassNotFoundException e) { 91 e.printStackTrace(); 92 } catch (InstantiationException e) { 93 e.printStackTrace(); 94 } catch (IllegalAccessException e) { 95 e.printStackTrace(); 96 } catch (Exception e) { 97 e.printStackTrace(); 98 } 99 } 100 101 } 102 | Popular Tags |