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

26
LINES

< > BotCompany Repo | #1016967 // Remember Words Seen In Any Swing Component, Multi Set Version

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

Libraryless. Click here for Pure Java version (14826L/101K).

1  
!7
2  
3  
sclass RememberAllWords > DynPrintLog {
4  
  new MultiSet<S> wordSet; // synchronized
5  
  int interval = 5000;
6  
  
7  
  void start {
8  
    doEveryAndNow(interval, r doIt);
9  
  }
10  
  
11  
  void doIt {
12  
    temp enter();
13  
    please include function getText.
14  
    for (Component c : allComponentsInWindows()) {
15  
      S text = (S) callOpt(mc(), 'getText, c); // Reflection abuse!
16  
      if (nempty(text)) {
17  
        L<S> words = words2_noNumbers(text);
18  
        if (nempty(words)) {
19  
          wordSet.addAll(words);
20  
          change();
21  
        }
22  
      }
23  
    }
24  
    print(n2(wordSet.uniqueSize(), "word") + ", " + n2(wordSet.size(), "occurrence"));
25  
  }
26  
}

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: #1016967
Snippet name: Remember Words Seen In Any Swing Component, Multi Set Version
Eternal ID of this version: #1016967/6
Text MD5: 96773fc5e2b1afff941ef0b0b0e3a966
Transpilation MD5: 73dca9eff82ba7455cdf578ddbd6e8c6
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-09 16:01:30
Source code size: 654 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 426 / 534
Version history: 5 change(s)
Referenced in: [show references]