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

17
LINES

< > BotCompany Repo | #1013347 // blinkWindowUsingSize - this one actually seems to work

JavaX fragment (include)

static void blinkWindowUsingSize(JWindow w) {
  blinkWindowUsingSize(w, -1);
}

static void blinkWindowUsingSize(final JWindow w, final int howOften) {
  final Dimension size = w.getSize();
  awtEvery(w, 1000, new Runnable {
    bool on = true;
    int n = howOften*2;
    
    public void run() {
      w.setSize((on = !on) ? size : new Dimension(0, 0));
      if (howOften > 0 && --n <= 1)
        w.dispose();
    }
  });
}

Author comment

Began life as a copy of #1013344

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013347
Snippet name: blinkWindowUsingSize - this one actually seems to work
Eternal ID of this version: #1013347/6
Text MD5: 46409984b89b82e3611098ec3ee58d07
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-02 23:15:59
Source code size: 442 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 316 / 341
Version history: 5 change(s)
Referenced in: [show references]