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

15
LINES

< > BotCompany Repo | #1005614 - onClick

JavaX fragment (include)

static <A extends JComponent> A onClick(final A c, fO runnable) {
  if (c != null) swing {
    c.addMouseListener(new MouseAdapter {
      public void mouseClicked(MouseEvent e) {
        callF(runnable, e);
      }
    });
  }
  ret c;
}

// re-interpreted for buttons
static void onClick(JButton btn, final O runnable) {
  onEnter(btn, runnable);
}

Author comment

Began life as a copy of #1003586

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005614
Snippet name: onClick
Eternal ID of this version: #1005614/3
Text MD5: 0c034aab4aae16bfbac727ff0ad93f66
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-10 23:31:03
Source code size: 364 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 365 / 370
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1005614 & http://1005614.tinybrain.de