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).

1  
import java.awt.datatransfer.StringSelection;
2  
3  
static S copyTextToClipboard(O _text) {
4  
  S text = str(_text);
5  
  StringSelection selection = new StringSelection(text);
6  
  Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection);
7  
  vmBus_send('newClipboardContents, text);
8  
  ret text;
9  
}

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: 660 / 776
Version history: 2 change(s)
Referenced in: [show references]