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

15
LINES

< > BotCompany Repo | #1005075 // addActionListener - synonym of onEnter for JTextField

JavaX fragment (include)

static void addActionListener(JTextField tf, final Runnable action) {
  onEnter(tf, action);
}

static void addActionListener(final JComboBox cb, final Runnable action) {
  if (cb != null) swing {
    cb.addActionListener(actionListener(action));
  }
}

static void addActionListener(final AbstractButton b, final Runnable action) {
  if (b != null) swing {
    b.addActionListener(actionListener(action));
  }
}

Author comment

Began life as a copy of #1001788

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: #1005075
Snippet name: addActionListener - synonym of onEnter for JTextField
Eternal ID of this version: #1005075/5
Text MD5: 911f1253a06a0440d5a78b13a8bbaa3a
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-06 23:05:08
Source code size: 426 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 650 / 677
Version history: 4 change(s)
Referenced in: [show references]