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

14
LINES

< > BotCompany Repo | #1026810 // tempOnWindowStateChanged

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

Libraryless. Click here for Pure Java version (2475L/16K).

1  
static AutoCloseable tempOnWindowStateChanged(Component c, Runnable r) {
2  
  ret c == null ? null : swing(() -> {
3  
    Window w = getWindow(c);
4  
    if (w == null) null;
5  
    WindowListener l = new WindowAdapter {
6  
      public void windowIconified(WindowEvent e) {
7  
        temp tempRememberListener(w, 'removeWindowListener, this);
8  
        pcallF(r);
9  
      }
10  
    };
11  
    w.addWindowListener(l);
12  
    ret autoCloseable { swing { w.removeWindowListener(l); } };
13  
  });
14  
}

Author comment

Began life as a copy of #1025644

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026810
Snippet name: tempOnWindowStateChanged
Eternal ID of this version: #1026810/1
Text MD5: 3e4ca15c0daed6df3e71391f97c2de1f
Transpilation MD5: 619257ce6db1c2a597af9a8f66edbe38
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-23 19:38:26
Source code size: 473 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 216 / 287
Referenced in: [show references]