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

40
LINES

< > BotCompany Repo | #1001437 // swing-top: Bots table (developing)

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

Libraryless. Click here for Pure Java version (468L/4K/18K).

!747
!actionListener {
!awt {

m {
  static JTable tbl;
  static int delay = 3000;
  static boolean withVMs = true;
  
  p {
    JFrame frame = new JFrame("Bots Table (developing)");
    frame.setBounds(10, 10, 400, 400);

    tbl = new JTable();
    updateBotList();
    
    frame.getContentPane().add(new JScrollPane(tbl));
    frame.setVisible(true);
    
    installTimer(tbl, runnable {
      updateBotList();
    }, delay);
  }
  
  static new MonoThread update;
  
  !include #1001434 // MonoThread
  
  static void updateBotList() {
    update.run(runnable {
      new L<L<S>> bots;
      for (ProgramScan.Program p : quickBotScan()) {
        if (withVMs || indexOfIgnoreCase(p.helloString, "This is a JavaX VM.") != 0)
          bots.add(litlist(firstPartOfHelloString(p.helloString), "" + p.port));
      }
      sortByFirstColumn(bots);
      fillTableWithStrings(tbl, bots, "Hello message", "Port");
    });
  }
}

Author comment

Began life as a copy of #1001430

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001437
Snippet name: swing-top: Bots table (developing)
Eternal ID of this version: #1001437/1
Text MD5: 3c9f3488fe06778020484443aebd78c4
Transpilation MD5: 3257377f806b04eb2d733b6b16acb17a
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-22 21:39:18
Source code size: 966 bytes / 40 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 673 / 908
Referenced in: [show references]