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

31
LINES

< > BotCompany Repo | #1025712 // Switch OS Look & Feel

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (3521L/18K).

1  
!7
2  
3  
cmodule SwitchLAF {
4  
  transient SS entries = litorderedmap(
5  
    "" := "Default (Windows/JTattoo)",
6  
    //"webLAF" := "WebLAF", // BROKEN
7  
    "jtattoo" := "JTattoo",
8  
    "nimbus" := "Nimbus",
9  
    "substance" := "Substance",
10  
    "substance Creme" := "Substance/Creme",
11  
    "substance Sahara" := "Substance/Sahara",
12  
    "platform" := "Platform");
13  
  
14  
  visualize {
15  
    if (!hasMethodNamed(dm_os(), 'setLAF))
16  
      ret jcenteredlabel("Please upgrade " + dm_osName());
17  
      
18  
    ButtonGroup buttons = jRadioButtons(values(entries));
19  
    S laf = cast dm_callOSOpt getLAF();
20  
    selectRadioButton(buttons, indexOfIC(keysList(entries), laf));
21  
    onRadioButtonChange(buttons, voidfunc(int i) {
22  
      S laf = _get(keysList(entries), i);
23  
      dm_callOS setLAF(laf);
24  
      thread {
25  
        if (confirmOKCancel("Look&Feel changed. Restart " + dm_osName() + "?"))
26  
        dm_restartOS();
27  
      }
28  
    });
29  
    ret jfullcenter(vstackWithSpacing(buttonsInGroup(buttons)));
30  
  }
31  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025712
Snippet name: Switch OS Look & Feel
Eternal ID of this version: #1025712/12
Text MD5: b6e03f8c367568e67611edd417f7e72f
Transpilation MD5: 9a8e69c2f7a977aeb71ce084e05850ba
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-15 16:07:21
Source code size: 996 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 138 / 1371
Version history: 11 change(s)
Referenced in: [show references]