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

8
LINES

< > BotCompany Repo | #1024646 // bindAutoCloseableToComponent

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

Libraryless. Click here for Pure Java version (2126L/14K).

static <A extends JComponent> A bindAutoCloseableToComponent(IF0<AutoCloseable> f, A component) {
  new Var<AutoCloseable> var;
  ret bindToComponent(component, r {
    var.set(callF(f));
  }, r {
    close(getAndClearVar(var))
  });
}

Author comment

Began life as a copy of #1003557

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024646
Snippet name: bindAutoCloseableToComponent
Eternal ID of this version: #1024646/1
Text MD5: ad20c6c0fdf62b1813cb7e9c89a0a52a
Transpilation MD5: 55f8cae79ccebb4f414924de8ca9baac
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-21 15:40:43
Source code size: 242 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 187 / 268
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)