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

23
LINES

< > BotCompany Repo | #1025678 // Free Disk Space Tray Icon [checks home partition]

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

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

1  
!7
2  
3  
cmodule FreeDiskSpaceTrayIcon > DynBigNumber {
4  
  switchable bool inGigabytes = true;
5  
  transient JLabel lbl;
6  
7  
  start {
8  
    setDescription("FREE DISK");
9  
    dm_addTrayIcon(onLeftClick(rThread dm_showModule, lbl = jlabel()));
10  
    componentPopupMenuItems(lbl,
11  
      "Show Module", rThread dm_showModule,
12  
      "Remove", rThread dm_deleteModule);
13  
    doEveryAndNow(5000, r actualUpdate);
14  
  }
15  
  
16  
  void actualUpdate {
17  
    //time "FDS" { // 0-1 ms
18  
      setValue(str_toGBorMB(inGigabytes, freeDiskSpace()));
19  
      setText(lbl, "[" + value + "]");
20  
      toolTip(lbl, "Free space on home partition: " + value);
21  
    //}
22  
  }
23  
}

Author comment

Began life as a copy of #1016860

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: #1025678
Snippet name: Free Disk Space Tray Icon [checks home partition]
Eternal ID of this version: #1025678/6
Text MD5: f4f2e03a6ea9612874d6493984406bb5
Transpilation MD5: ed8ce40808bb385e8d516329e6c39bf2
Author: stefan
Category: javax / modules
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-13 18:34:48
Source code size: 643 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 199 / 477256
Version history: 5 change(s)
Referenced in: [show references]