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

10
LINES

< > BotCompany Repo | #1033902 // buttonActionWithCloseablePre

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

Libraryless. Click here for Pure Java version (5538L/30K).

1  
static Runnable buttonActionWithCloseablePre(Runnable r, IF1<JButton, AutoCloseable> pre) {
2  
  ret -> { pcall {
3  
    JButton button = heldInstance(JButton);
4  
    thread {
5  
      var closeable = pre?.get(button);
6  
      pcallF(r);
7  
      close(closeable);
8  
    }
9  
  }};
10  
}

Author comment

Began life as a copy of #1033901

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033902
Snippet name: buttonActionWithCloseablePre
Eternal ID of this version: #1033902/6
Text MD5: 135cb56fda66a4174b9a88bdb87e7bd0
Transpilation MD5: 8fd0e66279c11bf1b61785e14697cea0
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-03 01:27:26
Source code size: 271 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 144 / 207
Version history: 5 change(s)
Referenced in: [show references]