Libraryless. Click here for Pure Java version (11133L/64K).
sclass JDraggableBoxDemo is Swingable { cachedVisualize { var parent = jpanelWithoutLayoutManager(); var box = jMinSize(400, 300, jcenteredlabel("Drag or resize me!")); setBorder(box, BorderFactory.createLineBorder(Color.green, 10); onMouseDown(box, event -> { if (!mouseEventIsInBorder(event)) { printVars("ComponentDragger start"); new ComponentDragger(box, event).debug(true).start(); } }); new ComponentResizeDragger(box, box).debug(true); setBounds(box, 50, 50, 400, 300); addToContainer(parent, box); ret parent; } }
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, iveijnkanddl, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1035243 |
Snippet name: | JDraggableBoxDemo |
Eternal ID of this version: | #1035243/5 |
Text MD5: | 3841c7b16c00ea18aa3d6d26132fde9d |
Transpilation MD5: | 049992f38078e18ae1d991d13fb4185f |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-05-14 03:17:49 |
Source code size: | 606 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 166 / 275 |
Version history: | 4 change(s) |
Referenced in: | [show references] |