static void tableEnableDrag(final JTable table, TransferHandler th) { if (table.getDragEnabled()) { print("Table drag already enabled"); ret; } table.setDragEnabled(true); table.setTransferHandler(th); table.addMouseListener(new MouseAdapter { @Override public void mousePressed(MouseEvent e) { if (e.getButton() == 1 && e.getClickCount() == 1) table.getTransferHandler().exportAsDrag(table, e, TransferHandler.COPY); } }); }
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: | #1007217 |
Snippet name: | tableEnableDrag |
Eternal ID of this version: | #1007217/10 |
Text MD5: | a39508338551791c510efaa81c1b14de |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-22 22:24:42 |
Source code size: | 485 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 542 / 544 |
Version history: | 9 change(s) |
Referenced in: | [show references] |