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

9
LINES

< > BotCompany Repo | #1005363 // copyTextToClipboard (returns the argument)

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

Libraryless. Click here for Pure Java version (2700L/16K).

import java.awt.datatransfer.StringSelection;

static S copyTextToClipboard(O _text) {
  S text = str(_text);
  StringSelection selection = new StringSelection(text);
  Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection);
  vmBus_send('newClipboardContents, text);
  ret text;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005363
Snippet name: copyTextToClipboard (returns the argument)
Eternal ID of this version: #1005363/3
Text MD5: 1c7fc321f4a1815228bd95986d463ec4
Transpilation MD5: 80b895881fa166cff84d94d546d770ab
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-15 22:03:50
Source code size: 317 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 567 / 664
Version history: 2 change(s)
Referenced in: #1006060 - copyImageToClipboard
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1019177 - copyFileToClipboard (returns the argument)
#1019713 - copyTextToClipboardIfNotNull
#1022659 - copyTextToClipboard_infoBox (returns the argument)