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

8
LINES

< > BotCompany Repo | #1033903 // tempSetButtonImage

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

Libraryless. Click here for Pure Java version (7213L/42K).

static AutoCloseable tempSetButtonImage(JButton btn, ImageIcon img) {
  if (btn == null) null;
  ret swing(-> {
    Icon oldIcon = btn.getIcon();
    setButtonImage(btn, img);
    ret autoCloseable { setButtonImage(btn, oldIcon); };
  });
}

Author comment

Began life as a copy of #1023958

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033903
Snippet name: tempSetButtonImage
Eternal ID of this version: #1033903/1
Text MD5: 20aa21eae7adb425e5958e2911beddd6
Transpilation MD5: 3d3b8c4ca8c3ee9f5f9abe22cfe3f77a
Author: stefan
Category: javax / android
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-09 19:35:44
Source code size: 247 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 183 / 219
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1034348 - tempSetButtonImages