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

15
LINES

< > BotCompany Repo | #1034169 // onMouseDown_anyButton

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

Libraryless. Click here for Pure Java version (4753L/26K).

1  
static MouseAdapter onMouseDown_anyButton(Component c, Runnable r) {
2  
  ret onMouseDown(c, runnableToIVF1(r));
3  
}
4  
5  
static MouseAdapter onMouseDown_anyButton(Component c, IVF1<MouseEvent> f) {
6  
  ret c == null || f == null ?: swing(-> {
7  
    MouseAdapter ma = new {
8  
      public void mousePressed(MouseEvent e) {
9  
        f.get(e);
10  
      }
11  
    };
12  
    c.addMouseListener(ma);
13  
    ret ma;
14  
  });
15  
}

Author comment

Began life as a copy of #1018604

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034169
Snippet name: onMouseDown_anyButton
Eternal ID of this version: #1034169/1
Text MD5: c98313f48a9592b701604c42d1f7d83d
Transpilation MD5: d3f3887e5af520a8d4b9e44fc745bec5
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-25 18:17:03
Source code size: 402 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 125 / 198
Referenced in: [show references]