Download Jar. Uses 8319K of libraries. Click here for Pure Java version (6897L/36K).
1 | !7 |
2 | |
3 | set flag Processing2. |
4 | |
5 | please include function pMain. |
6 | |
7 | p { |
8 | final PGauge gauge1 = pMain(PGauge); |
9 | Window w = getWindow(gauge1); |
10 | for (WindowListener l : w.getWindowListeners()) |
11 | w.removeWindowListener(l); |
12 | getParent(gauge1).remove(gauge1); |
13 | disposeWindow(w); |
14 | showPackedFrame(gauge1); |
15 | printComponentTree(getFrame(gauge1)); |
16 | //hideConsole(); |
17 | |
18 | repeat with sleep 1 { |
19 | GlobalMemory m = oshi_systemMemory(); |
20 | double percent = 100-percentRatio(m.getAvailable()-m.getSwapUsed(), m.getTotal()); |
21 | S title = "RAM used"; |
22 | |
23 | // scale to 180 |
24 | //pgauge_showDiskSpace(gauge1, title, percent); |
25 | |
26 | // scale to 100 |
27 | gauge1.setValue(percent, iround(percent) + "% of " + title); |
28 | } |
29 | } |
Began life as a copy of #1016725
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016726 |
Snippet name: | Show RAM usage as gauge in JFrame (Processing 2, OK) |
Eternal ID of this version: | #1016726/11 |
Text MD5: | 8a6f14e33e4ee97de52a0c62908ae584 |
Transpilation MD5: | 0ea8f56cf4b521ee5ba12f0cec821d38 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-30 15:09:44 |
Source code size: | 737 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 451 / 924 |
Version history: | 10 change(s) |
Referenced in: | [show references] |