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

14
LINES

< > BotCompany Repo | #1004395 // awt_onFileChange

JavaX fragment (include)

static void awt_onFileChange(double seconds, JComponent componentToBindTo, final File file, final long lastModificationSeen, final Runnable r) {
  installTimer(componentToBindTo, toMS(seconds), new Runnable {
    long lastMod = lastModificationSeen;
    public void run() {
      long mod = file.lastModified();
      if (mod != lastMod) {
        lastMod = mod;
        call(r);
      }
    }
  });
  
  swingAndWait(r);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004395
Snippet name: awt_onFileChange
Eternal ID of this version: #1004395/1
Text MD5: dc9bcb4d726a69b3f4aaeb688f4787d5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-15 17:49:57
Source code size: 436 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 554 / 538
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010992 - onFileChange