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

20
LINES

< > BotCompany Repo | #1009661 // onWindowClosing

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (5014L) is out of date.

// legacy
static <A extends Window> A onWindowClosing(A w, O r) {
  ret onWindowClosing(w, toRunnable(r));
}

static <A extends Window> A onWindowClosing(A w, Runnable r) {
  if (w != null) swing {
    w.addWindowListener(new WindowAdapter {
      public void windowClosing(WindowEvent e) {
        temp tempRememberListener(w, 'removeWindowListener, this);
        pcallF(r);
      }
    });
  }
  ret w;
}

static <A extends Window> A onWindowClosing(Runnable r, A w) {
  ret onWindowClosing(w, r);
}

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: #1009661
Snippet name: onWindowClosing
Eternal ID of this version: #1009661/10
Text MD5: ff9623ae426325c4c13c7e187c7f4717
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-05 05:16:27
Source code size: 521 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 640 / 709
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1015566 - onFrameClosing - extended synonym of onWindowClosing
#1015804 - onInternalFrameClosing
#1016007 - onWindowClosingOnly - disable normal closing
#1016868 - onWindowActivated
#1021845 - onWindowClosed
#1025643 - onFrameIconified