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

20
LINES

< > BotCompany Repo | #1006660 - onLeftClick

JavaX fragment (include)

// runnable takes an argument
static <A extends JComponent> A onLeftClick(final A c, fO runnable) {
  swing {
    c.addMouseListener(leftClickMouseAdapter(runnable));
  }
  ret c;
}

// runnable takes no args
static TrayIcon onLeftClick(final TrayIcon c, final O runnable) {
  swing {
    c.addMouseListener(leftClickMouseAdapter_noPt(runnable));
  }
  ret c;
}


static <A extends JComponent> A onLeftClick(fO runnable, A c) {
  ret onLeftClick(c, runnable);
}

Author comment

Began life as a copy of #1005614

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1006660
Snippet name: onLeftClick
Eternal ID of this version: #1006660/11
Text MD5: 336b6188cdcd8d4bf1b5edf5b0377f01
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-02 00:08:20
Source code size: 476 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 377 / 361
Version history: 10 change(s)
Referenced in: [show references]

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