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).

1  
!752
2  
//1003438 // Substance Lite
3  
lib 1003442 // Substance
4  
lib 1003441 // Trident (required by Substance)
5  
//1003443
6  
//1003444
7  
8  
import org.pushingpixels.substance.api.*;
9  
import org.pushingpixels.substance.api.skin.*;
10  
11  
static S skinName =
12  
  //"Magellan"; // blue background is kind of hard to read
13  
  "Creme";
14  
15  
p {
16  
  if (substanceLookAndFeelEnabled()) ret;
17  
  
18  
  swingAndWait(r {
19  
    ClassLoader cl = main.class.getClassLoader();
20  
    //print("LAF: " + getLookAndFeel());
21  
    UIManager.getDefaults().put("ClassLoader", cl);
22  
  
23  
    // Fix class lookup for Trident.
24  
    // Not completely sure if this works all the time.
25  
    // There might be multiple AWT threads?
26  
    // If there's one, it works.
27  
    Thread.currentThread().setContextClassLoader(cl);
28  
    //UIManager.setLookAndFeel(new SubstanceCremeLookAndFeel());
29  
    S skinClassName = "org.pushingpixels.substance.api.skin." + addSuffix(skinName, "Skin");
30  
    SubstanceSkin skin = (SubstanceSkin) nuObject(cl.loadClass(skinClassName));
31  
    SubstanceLookAndFeel.setSkin(skin);
32  
 
33  
    updateLookAndFeelOnAllWindows();
34  
    
35  
    if (substanceLookAndFeelEnabled())
36  
      print("Substance L&F enabled.");
37  
    else
38  
      print("Could not enable Substance L&F?");
39  
  });
40  
}

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: 533 / 3975
Referenced in: [show references]