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

32
LINES

< > BotCompany Repo | #1001732 // Swing: List VMs (v2, with table, developing)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2373L/16K/56K).

!752

static JTable tbl;
static int delay = 3000;
static boolean withVMs = true;

p {
  tbl = showTable("Local VMs");
  getFrame(tbl).setBounds(10, 10, 400, 400);
  
  updateList();
  installTimer(tbl, runnable { updateList(); }, delay);
}

static new MonoThread update;
!include #1001434 // MonoThread

static void updateList() {
  update.run(runnable {
    new L<Map> l;
    for (ProgramScan.Program p : quickBotScan()) {
      if (startsWithIgnoreCase(p.helloString, "This is a JavaX VM.")) {
        S botName = firstPartOfHelloString(p.helloString);
        S vmID = sendToLocalBot(p.port, "get vm id");
        l.add(litmap("VM Name", botName, "Port", p.port, "VM ID", vmID));
      }
    }
    // sortByField(l, "bla");
    dataToTable(tbl, l);
    setFrameTitle(tbl, n(l(l), "local VM"));
  });
}

Author comment

Began life as a copy of #1001680

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001732
Snippet name: Swing: List VMs (v2, with table, developing)
Eternal ID of this version: #1001732/1
Text MD5: 139904150090da5e8dc8f4e115fe6e6a
Transpilation MD5: 9d0e17d04464604a2c1dcf2e272212af
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-06-15 00:57:58
Source code size: 837 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 499 / 1260
Referenced in: [show references]