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

11
LINES

< > BotCompany Repo | #1017187 // tempEnableButton

JavaX fragment (include)

static AutoCloseable tempEnableButton(final JButton b) {
  if (b == null) null;
  bool wasEnabled = swing(func -> bool {
    bool wasEnabled = isEnabled(b);
    if (!wasEnabled)
      enableButton(b);
    ret wasEnabled;
  });
  if (wasEnabled) null;
  ret autocloseable { disableButton(b); };
}

Author comment

Began life as a copy of #1016305

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: #1017187
Snippet name: tempEnableButton
Eternal ID of this version: #1017187/1
Text MD5: ed0b47f2703c708518d8be31baec54ef
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-13 18:08:04
Source code size: 305 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 289 / 316
Referenced in: [show references]