import java.awt.datatransfer.*; static void tableEnableTextDrag(final JTable table) { TransferHandler th = new TransferHandler { @Override public int getSourceActions(JComponent c) { ret COPY; } @Override protected Transferable createTransferable(JComponent c) { //print("Row/Column: " + table.getSelectedRow() + " / " + table.getSelectedColumn()); O o = selectedTableCell(table); //print("Value: " + o); return new StringSelection(str(o)); } }; tableEnableDrag(table, th); }
Began life as a copy of #1007217
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007218 |
Snippet name: | tableEnableTextDrag |
Eternal ID of this version: | #1007218/4 |
Text MD5: | 6274dcef70c2b0cf1091ed719508b2e1 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-05-20 20:15:56 |
Source code size: | 543 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 589 / 594 |
Version history: | 3 change(s) |
Referenced in: | [show references] |