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).

1  
!747
2  
!actionListener {
3  
!awt {
4  
5  
m {
6  
  static JTable tbl;
7  
  static int delay = 3000;
8  
  static boolean withVMs = true;
9  
  
10  
  p {
11  
    JFrame frame = new JFrame("Bots Table (developing)");
12  
    frame.setBounds(10, 10, 400, 400);
13  
14  
    tbl = new JTable();
15  
    updateBotList();
16  
    
17  
    frame.getContentPane().add(new JScrollPane(tbl));
18  
    frame.setVisible(true);
19  
    
20  
    installTimer(tbl, runnable {
21  
      updateBotList();
22  
    }, delay);
23  
  }
24  
  
25  
  static new MonoThread update;
26  
  
27  
  !include #1001434 // MonoThread
28  
  
29  
  static void updateBotList() {
30  
    update.run(runnable {
31  
      new L<L<S>> bots;
32  
      for (ProgramScan.Program p : quickBotScan()) {
33  
        if (withVMs || indexOfIgnoreCase(p.helloString, "This is a JavaX VM.") != 0)
34  
          bots.add(litlist(firstPartOfHelloString(p.helloString), "" + p.port));
35  
      }
36  
      sortByFirstColumn(bots);
37  
      fillTableWithStrings(tbl, bots, "Hello message", "Port");
38  
    });
39  
  }
40  
}

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: 739 / 1001
Referenced in: [show references]