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

35
LINES

< > BotCompany Repo | #1027029 // Lock Screen with CPU meter

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

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

1  
!7
2  
3  
cmodule LockScreenWithCPU > DynSingleFunction {
4  
  switchable bool withConfirm; // to filter out accidental clicks
5  
  transient JFrame frame;
6  
  transient JLabel label;
7  
  
8  
  start {
9  
    dm_require("#1026796/CombinedCPUTrayIcon");
10  
    dm_vmBus_onMessage_q newCombinedCPUTrayImage(voidfunc(O mod, BufferedImage image) {
11  
      setImage(label, image);
12  
    });
13  
  }
14  
  
15  
  void doIt { showFullscreen(); }
16  
  
17  
  void showFullscreen enter {
18  
    if (frame != null) activateFrame(frame);
19  
    label = jcenteredlabel("Lock mode!");
20  
    frame = showFullScreen(jfullcenter(
21  
      centerAndSouthWithMargins(
22  
        label,
23  
        jMarginButton(20, "Exit", rThread exitStep2))));
24  
    onFrameClose(frame, r { frame = null; });
25  
  }
26  
  
27  
  void exitFullscreen enter {
28  
    disposeFrame(frame);
29  
  }
30  
  
31  
  void exitStep2 enter {
32  
    /*if (!withConfirm) TODO */
33  
    exitFullscreen();
34  
  }
35  
}

Author comment

Began life as a copy of #1027028

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1027029
Snippet name: Lock Screen with CPU meter
Eternal ID of this version: #1027029/5
Text MD5: 13826813a2847f06e90aaf44d07f4873
Transpilation MD5: 9ceb2b189ed42dfadcae84848d2bd4c9
Author: stefan
Category: javax / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-11 18:28:22
Source code size: 896 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 195 / 297
Version history: 4 change(s)
Referenced in: [show references]