Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

40
LINES

< > BotCompany Repo | #1003448 // Enable Substance Look-And-Feel (used by standard function substanceLAF)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 2016K of libraries. Click here for Pure Java version (493L/4K/14K).

!752
//1003438 // Substance Lite
lib 1003442 // Substance
lib 1003441 // Trident (required by Substance)
//1003443
//1003444

import org.pushingpixels.substance.api.*;
import org.pushingpixels.substance.api.skin.*;

static S skinName =
  //"Magellan"; // blue background is kind of hard to read
  "Creme";

p {
  if (substanceLookAndFeelEnabled()) ret;
  
  swingAndWait(r {
    ClassLoader cl = main.class.getClassLoader();
    //print("LAF: " + getLookAndFeel());
    UIManager.getDefaults().put("ClassLoader", cl);
  
    // Fix class lookup for Trident.
    // Not completely sure if this works all the time.
    // There might be multiple AWT threads?
    // If there's one, it works.
    Thread.currentThread().setContextClassLoader(cl);
    //UIManager.setLookAndFeel(new SubstanceCremeLookAndFeel());
    S skinClassName = "org.pushingpixels.substance.api.skin." + addSuffix(skinName, "Skin");
    SubstanceSkin skin = (SubstanceSkin) nuObject(cl.loadClass(skinClassName));
    SubstanceLookAndFeel.setSkin(skin);
 
    updateLookAndFeelOnAllWindows();
    
    if (substanceLookAndFeelEnabled())
      print("Substance L&F enabled.");
    else
      print("Could not enable Substance L&F?");
  });
}

Author comment

Began life as a copy of #1003439

download  show line numbers  debug dex  old transpilations   

Travelled to 42 computer(s): agxbjmyenqqu, aoiabmzegqzx, ayokdxtdmvtg, bhatertpkbcr, bwoimkvrfqyu, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, etmzoiygucik, etryasgzbotu, gwrvuhgaqvyk, iavmkmvmshxs, ishqpsrjomds, jmyaexzvplwz, jttmaavzamyx, jtubtzbbkimh, lhdilzshxjzv, lpdgvwnxivlt, mqqgnosmbjvj, nbgitpuheiab, nnmtytuibrzp, nzrhlmtlsyqh, omkuifhlbvuf, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, sekmkcqzslie, tpsnldywmnmr, tslmcundralx, tvejysmllsmz, unoaxrwscvea, uwnvikuolobj, vouqrxazstgt, vpdwwinrgdga, vqftxbmjmmzu, wglhsqxgxbdq, wnvtyfxbogru, xfasiavlzxuf, xhsrmoityime, xpvikbxxwzsu, xrpafgyirdlv

No comments. add comment

Snippet ID: #1003448
Snippet name: Enable Substance Look-And-Feel (used by standard function substanceLAF)
Eternal ID of this version: #1003448/1
Text MD5: 29c9752e60e17f8124fb58f262eb6ce6
Transpilation MD5: bee04eca044c13f0cd49751cf2f1360f
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-10 14:33:00
Source code size: 1247 bytes / 40 lines
Pitched / IR pitched: No / No
Views / Downloads: 534 / 3976
Referenced in: #1004053 - Bug
#1005653 - Enable Substance Look-And-Feel (latest build)
#1006704 - substanceLAF_external - enable Substance look and feel using hotwired program (idempotent)