java - Change the look and Feel to Frame by an other one in Netbeans -
hey guys i've 2 frames 1 login frame means it's main frame , other 1 it's application create method change look&feel radio button in main of frame when run application it's doesn't work if run without login frame works goood used change :
public static void changelaf(jframe frame) { try { uimanager.setlookandfeel(uimanager.getsystemlookandfeelclassname()); }catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } swingutilities.updatecomponenttreeui(frame); }
and
public static void changelaf(jframe frame, string laf) { if (laf.equals("nimbus")) { try { uimanager .setlookandfeel("javax.swing.plaf.nimbus.nimbuslookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("dark")) { try { uimanager .setlookandfeel("com.jtattoo.plaf.acryl.acryllookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("system")) { try { uimanager.setlookandfeel(uimanager .getsystemlookandfeelclassname()); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("sky")) { try { uimanager .setlookandfeel("com.jtattoo.plaf.aero.aerolookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("orange")) { try { uimanager .setlookandfeel("com.jtattoo.plaf.graphite.graphitelookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("dark2")) { try { uimanager .setlookandfeel("com.jtattoo.plaf.hifi.hifilookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("xp")) { try { uimanager .setlookandfeel("com.jtattoo.plaf.luna.lunalookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } if (laf.equals("texture")) { try { uimanager .setlookandfeel("com.jtattoo.plaf.texture.texturelookandfeel"); } catch (classnotfoundexception | instantiationexception | illegalaccessexception | unsupportedlookandfeelexception e) { } } swingutilities.updatecomponenttreeui(frame); }
Comments
Post a Comment